Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-10-05 16:47:43


Peter Dimov wrote:
> Hello,
>
> I've been tasked to implement approximate C++ equivalents of
>
> http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ArrayBlockingQueue.html
> http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/LinkedBlockingQueue.html
> http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ConcurrentHashMap.html

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.)

It appears to work (famous last words.) If you see any subtle problems or
can stress test it on a multiprocessor, please let me know.


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