Have you tried Boost LockFree ?
http://www.boost.org/doc/libs/1_55_0/doc/html/lockfree.html
which handle multiple producer/Multiple-consumer queue
Le 15/04/2015 08:42, Isaac To a ?crit :
> I'd like to write a C++ object where there are many logger threads
> logging to a large global (non-atomic) ring buffer, with an occasional
> reader thread which wants to read as much data in the buffer as
> possible. I ended up having a global atomic counter where loggers get
> locations to write to, and each logger increments the counter
> atomically before writing. The reader tries to read the buffer and
> per-logger local (atomic) variable to know whether particular buffer
> entries are busy being written by some logger, so as to avoid using them.