Boost logo

Threads-Devel :

Subject: Re: [Threads-devel] Threads and copy constructors...
From: oneflewover (thedeerhunter1978_at_[hidden])
Date: 2012-02-21 17:13:17


On 2012-02-21 09:38:37 +0000, Anthony Williams said:

> Which compiler are you using? If your compiler doesn't support rvalue
> references then there are lots of copies because various functions take
> things by value.
>
> The thread constructor: thread(F)
> which calls: make_thread_info(F)
> which constructs a thread_data<F>: thread_data(F)
> which constructs the thread_data<F> member.
>
> => 4 copies. With optimization enabled, some of these can be optimized out.

Thanks Anthony. That explains the copies. My gcc compiler does not
yet support rvalue references. Will upgrade soon.


Threads-Devel list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk