|
Boost Users : |
Subject: Re: [Boost-users] lockfree::spsc_queue & move semantics
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2014-11-24 02:15:23
On 11/11/2014 23:56, Thomas Danckaert wrote:
> As far as I see, the main problem storing unique_ptr's (or any other
> non-copyable but moveable object), is that the code relies on a copy
> constructor to store objects in its internal buffer. I added an
> overload using a move constructor and that seems to work (though I'm
> quite new to multi-threading or lockfree programming, so I could be
> missing some potential issues).
Things get hairier for MP and MC queues (in particular objects may get
copied multiple times, which can make moving unsafe), but that shouldn't
be an issue for an SPSC queue, so you ought to be fairly safe.
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