Skip to content

Instantly share code, notes, and snippets.

@sbarratt
Last active Jul 15, 2016
Embed
What would you like to do?
Windows multithreading in c++
//more details: http://www.bogotobogo.com/cplusplus/multithreaded2A.php
#include <Windows.h>
#include <process.h>
#include <stdio.h>
unsigned int __stdcall test_thread(void *data) {
printf("Thread Started");
return 0;
}
int main()
{
HANDLE myhandle = (HANDLE) _beginthreadex(NULL, 0, &test_thread, NULL, 0, 0);
WaitForSingleObject(myhandle, INFINITE);
CloseHandle(myhandle);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment