Why never call CreateThread?  What makes it so dangerous? 
CreateThread( ) is the Windows API for creating a thread, and _beginthreadex( ) is the CRT's equivalent.  _beginthreadex( ), in addition to calling CreateThread( ), sets up a number of thread-specific structures and data, which are used throughout CRT calls.  Now, if you use CreateThread( ), these structures are not set up, and effectively, the CRT is not available to your thread.
 
You can get away with using CreateThread( ), but it's actually very hard to do so.  According to the implementation, even some language features (like static variables, IINM) might not work if you call CreateThread( ).  So, unless you're programming in another language, always stick with _beginthreadex( ) so that the C/C++ standard library stuff don't stop working.

---------
Ehsan Akhgari

List Owner: [EMAIL PROTECTED]

[Email: [EMAIL PROTECTED]]
[WWW: http://www.beginthread.com/Ehsan ]
 
 

Under conditions of peace the warlike man attacks himself.
-Beyond Good And Evil, F. W. Nietzsche

Reply via email to