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@gmail.com> wrote:
On Thu, Feb 14, 2013 at 10:17 AM, chris <chris.herssens@gmail.com> 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@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users