What\'s a better way to start a thread, _beginthread, _beginthreadx or CreateThread?
I\'m trying to determine what are the adv
This is the code at the core of _beginthreadex (see crt\src\threadex.c):
/*
* Create the new thread using the parameters supplied by the caller.
*/
if ( (thdl = (uintptr_t)
CreateThread( (LPSECURITY_ATTRIBUTES)security,
stacksize,
_threadstartex,
(LPVOID)ptd,
createflag,
(LPDWORD)thrdaddr))
== (uintptr_t)0 )
{
err = GetLastError();
goto error_return;
}
The rest of _beginthreadex initializes per-thread data structure for CRT.
The advantage of using _beginthread* is that your CRT calls from thread will work correctly.