Boost logo

Boost :

Subject: Re: [boost] [move] new rvalue reference emulation
From: Dave Abrahams (dave_at_[hidden])
Date: 2012-01-31 11:15:50


on Tue Jan 31 2012, Anthony Williams <anthony.ajw-AT-gmail.com> wrote:

> On 30/01/12 18:44, Dave Abrahams wrote:
>>
>> on Mon Jan 23 2012, "Jeffrey Lee Hellrung, Jr."<jeffrey.hellrung-AT-gmail.com> wrote:
>>
>>> On Mon, Jan 23, 2012 at 10:16 AM, Vicente J. Botet Escriba<
>>> vicente.botet_at_[hidden]> wrote:
>>>
>>> at least, I'm guessing thread is pimpl'ed
>>
>> Reading this surprised me so much that I had to look for myself, and
>> indeed it does seem to be pimpl'ed. My understanding was that the
>> move-only threading components were designed so that they could be
>> implemented as efficiently as possible, without dynamic allocation, and
>> I wonder why Boost's implementation would be less efficient.
>
> "Efficiency" is in the eye of the beholder. The thread function
> supplied to the OS has to have various bits of data from the
> boost::thread constructor, not least of which the function (object) to
> call and its parameters. It has to store these somewhere that persists
> (at a fixed address) for the life of the thread, even if the
> boost::thread object is moved, or the thread is detached.

Oh, silly me. That makes sense. Thanks for the explanation.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk