Click to See Complete Forum and Search --> : chained dll initialization and their new threads
Pisto
October 17th, 2008, 01:43 PM
I know that any thread created in a DllMain won't start until it returns. But what if A.dll is loaded, in its initialization it calls LoadLibrary("B.dll"), and in B's initialization a thread T is created? will T start when the DllMain of B returns, or when the A one?
kirants
October 17th, 2008, 02:11 PM
Creating a thread in DllMain is not good. See here:
http://www.codeguru.com/forum/showthread.php?t=363663
Igor Vartanov
October 18th, 2008, 05:18 AM
To be precise, there's nothing wrong with creating threads in DllMain. But DllMain must not wait/sleep/lock, intentionally or indirectly, under any circumstances, and this rule must be strictly followed.
Pisto
October 18th, 2008, 07:59 AM
I can't see any other way to create a thread at load time but in the DllMain, and I'm sure I won't wait/suspend in it.
anyway, what about my original question?
Codeplug
October 18th, 2008, 08:51 AM
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 process.I'm going with "once all DLL's are initialized".
gg
Pisto
October 18th, 2008, 09:07 AM
I should have read that line better.
thx
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.