
13 Sep
2012
13 Sep
'12
4:44 p.m.
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. Regards, Eugene