$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
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.