Boost logo

Boost Users :

Subject: Re: [Boost-users] thread safe queue
From: Brian Budge (brian.budge_at_[hidden])
Date: 2011-07-19 16:25:49


On Tue, Jul 19, 2011 at 1:18 PM, Sean Farrow
<sean.farrow_at_[hidden]> wrote:
> Hi:
>
> Has anyone written or does anyone know of a thread safe queue that uses
> boost to allow it to be cross platform?
>
> Cheers
>
> Sean.
>

What functionality are you looking for exactly? There is a review in
process for the lock-free data structures library, which includes a
lock-free fifo. Otherwise, I think your best bet is to wrap accesses
to your std::queue with locks on a boost::mutex. If you want a
priority_queue, something like the latter is probably your only
option.

  Brian


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net