|
Boost : |
Subject: Re: [boost] boost.lockfree update
From: John Bytheway (jbytheway+boost_at_[hidden])
Date: 2010-07-25 05:49:40
On 25/07/10 09:50, Tim Blechmann wrote:
>> What exactly about PODs is it taking advantage of? In C++0x will it
>> work for all standard layout types?
>
> one needs to read the payload from the fifo node, before it is dequeued.
> this may happen more than once otherwise a later dequeue may free the node.
> it is nothing, c++0x can change, but a property of the michael/scott queue
> [1]. the type essentially needs a trivial copy constructor.
If that's all it needs then I suggest you phrase the limitation in those
terms; it's a lot less restrictive than requiring a POD type (which
cannot, for example, have any user-defined constructors).
> [1]
> http://www.cs.rochester.edu/research/synchronization/pseudocode/queues.html
If you implemented it exactly as it appears in this link then I guess it
really needs a trivial copy assignment operator, not a trivial copy
constructor, but of course the two tend to go hand-in-hand. You should
probably require both.
John Bytheway
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk