Boost logo

Boost Users :

Subject: Re: [Boost-users] [LockFree] a queue of std::shared_ptr?
From: Chris Herssens (chris.herssens_at_[hidden])
Date: 2013-02-15 02:53:38


If I define a structure that contains a shared_ptr. Can I put this
structure in a lockfree queue ?

On Thu, Feb 14, 2013 at 9:21 PM, Brian Budge <brian.budge_at_[hidden]> wrote:

> On Thu, Feb 14, 2013 at 10:17 AM, chris <chris.herssens_at_[hidden]> wrote:
> > Hello All,
> >
> > If we can't use shared_ptr in a lockfree queue, how can I share data
> > between different queue ?
> >
> > I have some data that I have to be put in different queues and I want to
> > avoid that I have to copy this data for each queue.
> >
>
> 1) Use raw pointers with boost lockfree queues
> 2) Use shared pointers with a std::queue and a boost::mutex to ensure
> thread safety (note that this may not necessarily be slower than using
> the lockfree queue)
> 3) Use moveable objects with boost container deque
>
> There are more options, if one of these does not suffice.
>
> Brian
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



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