Boost logo

Boost :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2002-04-10 05:16:41


there are some pitfalls using boost::thread on the win32 plattform
if DLLs are involved. As I could find nothing in the documentation
mentioning this I would like to ask if a strong warning could be
added, that creating threads in DllMain() or in a global object
living in a DLL will deadlock. This is especially suprising as
using _beginthread() or CreateThread() does work in such places.

The problem is, when boost::thread creates a thread it explicitly
waits for the start up of the newly created thread. But if the
creator of the thread itself is in DllMain() or something alike
the newly created thread won't start until the creator leaves

The documentation for CreateThread() in the plattform SDK says
the following on this subjekt: "During process startup and DLL
initialization routines, new threads can be created, but they
do not begin execution until DLL initialization is done for the


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