
5 Oct
2005
5 Oct
'05
9:47 p.m.
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/ArrayBlockingQu... http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/LinkedBlockingQ... http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ConcurrentHashM...
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.