In the current Win32 implementation, creating a boost::thread object during dll initialization will result in deadlock because the thread class constructor causes the current thread to wait on the thread that is being created until it signals that it has finished its initialization, and, as stated in the MSDN Library, "DllMain" article, "Remarks" section, "Because DLL notifications are serialized, entry-point functions should not attempt to communicate with other threads or processes. Deadlocks may occur as a result." (Also see "Under the Hood", January 1996 for a more detailed discussion of this issue).
The following non-exhaustive list details some of the situations that should be avoided until this issue can be addressed:
Last revised: July 17, 2004 at 04:33:59 GMT
|Copyright © 2001-2003 William E. Kempf|