Boost logo

Boost :

Subject: Re: [boost] [thread] get_id
From: Ingo Loehken (Ingo.Loehken_at_[hidden])
Date: 2010-11-18 13:13:24


Hi,

does anyone know, why boost::this_thread::get_id() is about 60 times
slower than PR_GetCurrentThread().

boost version : 1.42
platform and os : 32bit, win xp sp3
compiler : msvc8
lib : boost_thread-vc80-mt-p-1_42.dll

measured : 10 million executions of PR_GetCurrentThread and
boost::this_thread::get_id(), where the latter
took 1.5s and the previous only 75ms. Both measures with high performance
counter from outside the loop
and assignment to vector, to avoid optimizations by compiler.

What makes this so ridiculous, is that boost::thread_specific_ptr
performans quite well, as fast like
PR_GetCurrentThread. Do I ignore some implementation or optimization
intrinsics ?

Greetz, Ingo.


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