Memory barriers vs lock/unlock
Kurt Kohler
kohler@ao.com
Tue Nov 8 22:27:00 GMT 2005
I don't supposed it's *that* much of a coincidence, but I was
considering mentioning that I heard Paul give a talk here in Corvallis a
few weeks ago. He talked about memory barriers (and locks) and
recommended against them because of their cost in time. I suspect he'd
approve of a solution that didn't use any.
His basic premise (as I understand it) was that as processors become
faster, the time to do the real work in a critical section is getting
smaller and smaller compared to the price of locking (or memory
barriers). I think it would be fair to summarize his talk as "locks
considered harmful!"
Paolo Carlini wrote:
>Kurt Kohler wrote:
>
>
>
>>Just a useless comment... Back when I had that weird mutex problem
>>(thanks again for fixing that!) I noticed this lock/unlock sequence and
>>was highly puzzled. I showed it to our local multitasking guru and he
>>didn't understand it either. I'd be interested in hearing why such an
>>odd looking thing is necessary!
>>
>>
>>
>>
>By the way, about those topics, besides Peter's messages ;) and the
>usual references (Adve & Gharachorloo, Boehm) I suggest the two-part
>review that Paul E McKenney recently wrote for Linux Journal.
>
>Paolo.
>
>
More information about the Libstdc++
mailing list