Boost logo

Boost :

Subject: [boost] [Circular Buffer] Partial thread-safety
From: Lasse Kärkkäinen (tronic+67zr_at_[hidden])
Date: 2008-11-26 03:45:34


It would be very helpful if this container provided lock-free
thread-safe implementation of concurrent reads and writes by two threads
(producer-consumer), as such function is often needed where ring buffers
are used. A prime example of that being receiving audio from a callback
(possibly a signal handler), where the callback must not be blocked in
any circumstances (meaning that it cannot wait for a lock).

As this is a rather common use case, the realtime audio processing
framework JACK actually implements such lock-free ring buffer:

http://jackit.sourceforge.net/cgi-bin/lxr/http/source/libjack/ringbuffer.c

Is there any reason why Boost.circular_buffer should not also implement
this kind of thread-safety?


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