|
Boost : |
Subject: Re: [boost] [Circular Buffer] Partial thread-safety
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2008-11-26 05:57:26
----- Original Message -----
From: "Lasse Kärkkäinen" <tronic+67zr_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, November 26, 2008 9:45 AM
Subject: [boost] [Circular Buffer] Partial thread-safety
>
> 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?
Hi,
thanks for pointing this issue.
As you say this is a very common case, one producer, one consumer. The idea could also be useful for the ThreadPool library.
Where is the magic? Can you point to some documentation or how to use it?
Thanks,
Vicente
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk