Click here to Skip to main content
15,868,164 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am new to thread handling...i need clear idea about thread switching in windows. currently i am using windows vista. pls give me any guidence to start.
Posted

I think you want to know about multithread programming, Then i suggest you start from this,
http://www.tenouk.com/ModuleR.html[^].
This is where first i started and i am more comfortable with this.
 
Share this answer
 
Comments
lijiantao 1-Apr-11 23:40pm    
great!
http://www.tenouk.com/ModuleR.html[^].
I suggest this as a start (especialy if you are using Visual Studio):
http://www.bogotobogo.com/cplusplus/multithreaded2B.html[^]
 
Share this answer
 
v2
Comments
Albert Holguin 1-Apr-11 10:15am    
great tutorial for those using visual studio
Olivier Levrey 1-Apr-11 10:21am    
Yes you are right I forgot to mention it is only about Visual Studio. I will update my answer now. Thanks
For thread creation, you need a handle. After handle creation, you should call CreateThread() function and store the returned handle into your created handle. Also you should declare a function for your thread and use this function as a parameter for CreateThread() function. This function is a static DWORD WINAPI function that had a parameter with LPVOID type. You can use SetEvent function to fire an event for your thread. In Thread function you can use WaitForSingleObject() in a loop in order to catch a fired event. At the end of your program, you should close all created handles using CloseHandle() function.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900