Subject: Re: [boost] Interested in bounded buffer class for threaded producer/consumer communication?
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2011-12-13 07:29:42
boos.task has a bounded and a unbounded buffer - unfortunately I've to wait until boost.context will pass the mini-review before I can submit the refactored version of boost.task.
-------- Original-Nachricht --------
> Datum: Tue, 13 Dec 2011 13:23:26 +0100
> Von: "AndrÃ© Offringa" <offringa_at_[hidden]>
> An: boost_at_[hidden]
> Betreff: Re: [boost] Interested in bounded buffer class for threaded producer/consumer communication?
> On 12/13/2011 02:43 AM, Robert Ramey wrote:
> > AndrÃ© Offringa wrote:
> >> Hi all,
> >> I seem to have come across a producer/consumer situation a few times
> >> now, and everytime I do, I seem to want a slightly different
> >> functionality for a bounded buffer-kind of class that is not generally
> >> provided. I am looking for such a class that is also efficient for
> >> large amounts of data, and so I wonder if there does already exists a
> >> class in boost to efficiently push work between producers and
> >> consumers when they are running in different threads, i.e., that is
> >> safe. [..]
> > I used an example from circular_buffer library. Worked great
> > and only a few minutes to insert into my app.
> Hi Robert,
> Thanks for your reply. Just to clarify, that example was actually the
> one I was referring to my mail:
> "There is a bounded_buffer example given to implement such a thing with
> the circular buffer. It does exactly what I suggest, but I assume it is
> not so efficient for pushing large amounts of data over, as each
> individual object requires a push, thus a lock implemented as in
> bounded_buffer, and involves unnecessary updates of the counters
> (involving a decrement() each time) on each push, which is not necessary
> if you know you are pushing a number of elements at once. I assume this
> could be fixed by wrapping the insert(range) method instead of the
> individual push functions."
> Apart from not providing an efficient push of a range, it misses the
> write_end() functionality that I mentioned. Hence the question if that
> would be something which is generally useful, or if it is just in my case.
> Eitherway, I agree that the bounded_buffer example is on itself already
> useful in many situations.
> Unsubscribe & other changes:
-- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk