-
Multiprocessing?
Okay, I want to be able to do two or more things at once, and so far all I could find on the topic was multiprocessing. The problem is, I don't know how the heck to do this.
The easiest example of what I am asking for here would be a racing game. I want the clock to tick down, even if the user sits there doing nothing, while at the same time checking to see what key they press.
Anyhow, I am unsure how to do this and any help would be appreciated, thanks alot.
-
For Win32 you might do:
Code:
DWORD WINAPI my_func(void*param){
cout << "Thread running.";
}
HANDLE thread = CreateThread(NULL, 0, my_func, (void*)my_func_param, 0, &thread_id);
BTW: the function must have that exact signature, whether you use the parameter or not. If you don't want to pass one ( a parameter) you can leave the 4th argument to CreateThread NULL.
-
Thanks
Thanks, that was the code I was looking for.
-
FAQ material
^-----^
Could someone fill in the finer details?
I'm looking it up now.