Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-10-07 03:55:03


Anthony Williams wrote:
> "Peter Dimov" <pdimov_at_[hidden]> writes:
>
>> I have produced a read/write mutex implementation as a side effect,
>> available at
>>
>> http://www.pdimov.com/cpp/rw_mutex.cpp
>>
>> that is lock-free when there is no contention (i.e. when a reader
>> attempts a lock and no writers are active, or when a writer attempts
>> a lock and the lock is free.)
>
> wrlock() always locks not one, but *two* mutexes. I don't call that
> "lock free".

Yes, you are right, of course. Only rdlock() is lock-free when no writers
are active.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk