|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-04-23 09:15:34
Anthony Williams:
> shared_mutex algorithms are *hard* to get right.
I'm now tending towards the opinion that rwlocks are hard to use correctly
(and test). For the 2R+1W case I've been testing, it occurs to me that the
writer wait time is normal - statistically, the time for the two readers to
finish their timeslices of 1ms is expected to be 0.75ms.
A (possibly?) better test would not have a dedicated writer thread, but
would use a pool of generic worker threads that alternate between reading
and writing with a certain probability. I may try one at some point.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk