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: October 15, 2006 at 14:52:53 GMT
|Copyright © 2001-2003 William E. Kempf|