Windows Thread creation:
The CreateThread () function is a Windows-provided API interface
1, HANDLE WINAPI CreateThread (
Lpsecurity_attributeslpthreadattributes,
Size_tdwstacksize,
Lpthread_start_routinelpstartaddress,
Lpvoidlpparameter,
Dworddwcreationflags,
Lpdwordlpthreadid
);
Function Description:
The first parameter represents the security properties of the thread kernel object, and a general pass-through of NULL means that the default setting is used.
The second parameter represents the size of the line stacks space. Passing in 0 means using the default size (1MB).
The third parameter represents the address of the thread function that the new thread executes, and multiple threads can use the same function address.
The fourth parameter is a parameter passed to the thread function.
The fifth parameter specifies an additional flag to control the creation of the thread, 0 indicates that the thread is ready to be dispatched immediately after it is created, and if create_suspended indicates that the thread is created and paused, it cannot be dispatched until ResumeThread () is called.
The sixth parameter returns the ID number of the thread, and passing in null means that the thread ID number is not required to be returned.
function return value:
A handle to the new thread was successfully returned, and Null was returned for failure.
Call the C + + standard library to use
2, _mcrtimp uintptr_t __cdecl _beginthreadex (
void *security,
unsigned stacksize,
Unsigned (__clr_or_std_call * initialcode) (void *),
void * argument,
Unsigned createflag,
unsigned *thrdaddr
)
Excerpted from http://blog.csdn.net/morewindows/article/details/7421759
Windows Thread creation