
19 Sep
2006
19 Sep
'06
9:10 p.m.
Anthony Williams wrote:
"Peter Dimov" <pdimov@mmltd.net> 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:
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.