|
Boost : |
Subject: Re: [boost] [Review.Coroutine] Vicente's review
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2012-09-13 13:05:47
Le 13/09/12 18:44, Eugene Yakubovich a écrit :
>>>> Is the rationale for using self_t to get better performances?
>>>> Maybe both interfaces could be provided.
>>> At least it would introduce additional indirections.
>>>
>> I agree that a thread specific pointer is not gratuitous, but adding the
>> self_t parameter over the whole stack has its cost also.
>>
>> Providing both approaches would let the user choose which one is best
>> adapted to her context.
> I like not having the self parameter but using TLS can be slow. The
> use of Boost's thread_specific_ptr (which uses pthread api) is
> especially slow. Using gcc's __thread attribute is much faster (I
> think that's acceptable performance wise) but this route will make it
> harder to support all the compilers.
>
>
I agree that having a portable and efficient implementation will not
currently possible, but I expect that more a more compilers will finish
by implementing and thread local variables. I'm sure it is worth
implementing it and check the performances. Maybe it is possible to
implement it on top of the current interface.
I'm aware of the slowness of boost::thread_specific_ptr, and I'm
analyzing the implementation in order to see how it could be improved.
Best,
Vicente
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk