What\'s a better way to start a thread, _beginthread, _beginthreadx or CreateThread?
I\'m trying to determine what are the adv
CreateThread() is Windows API call that is language neutral. It just creates OS object - thread and returns HANDLE to this thread. All windows applications are using this call to create threads. All languages avoids direct API call for obvious reasons:
1. You don't want your code be OS specific
2. You need to do some house keeping before calling API-like: convert parameters and results, allocate temporary storage etc.
_beginthreadex() is C wrapper around CreateThread() that accounts for C specific. It enables original single threaded C f-ns work in multithreaded environment by allocating thread specific storage.
If you don't use CRT you cannot avoid a direct call to CreateThread(). If you use CRT, you must use _beginthreadex() or some CRT string f-ns may not work properly prior VC2005.