|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-09-19 17:10:31
Anthony Williams wrote:
> "Peter Dimov" <pdimov_at_[hidden]> writes:
>
>> Peter Dimov wrote:
>>
>>> This is what CRITICAL_SECTIONs do, and I recall being told by
>>> Alexander Terekhov that it is suboptimal (threads take the slow path
>>> when they could take the fast path). My tests with a contended queue
>>> seemed to prove him right.
>>>
>>> Unfortunately, I can no longer find his post where he explained that
>>> with Google.
>>
>> Here it is:
>>
>> http://aspn.activestate.com/ASPN/Mail/Message/boost/2122746
>
> Thanks. I'll have to look at Alexander's proposed swap-based
> implementation.
I've played with it a bit:
http://www.pdimov.com/cpp/mutex.cpp
but I suspect that there are a few errors in this old code... some of the
reads are not atomic but need to be. Maybe we can give it a review and bring
it up to Boost standards.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk