Boost logo

Boost :

Subject: Re: [boost] [Boost.Thread] ids obtained from the same thread not equal
From: Anthony Williams (anthony.ajw_at_[hidden])
Date: 2008-12-01 03:45:56

Karp Dantax <karpdantax_at_[hidden]> writes:

> Using boost::thread::get_id() in an executable and one of its DLLs
> generate different ids although the calls are made from the same
> thread. Until Boost 1.34.1, which used GetCurrentThreadId() to compare
> two boost::thread objects, it worked perfectly. I have not delved into
> the code, but now that the library is using thread local storage to
> store the current thread id, it is not working in the context
> mentioned above.
> Well, thats it. Maybe i am missing something here?

If you wish to use the thread library from the main executable and a
DLL and have everything work nicely together, you need to use the DLL
build of Boost.Thread. If your main EXE and DLL use Boost.Thread
internally, but entirely separately, then you can statically link to
the thread library independently in each.


Anthony Williams
Author of C++ Concurrency in Action |
Custom Software Development |
Just Software Solutions Ltd, Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK

Boost list run by bdawes at, gregod at, cpdaniel at, john at