Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ CodeProject
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 1-Apr-11 3:06am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
lijiantao at 1-Apr-11 23:40pm
   
great!
http://www.tenouk.com/ModuleR.html[^].
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I suggest this as a start (especialy if you are using Visual Studio):
http://www.bogotobogo.com/cplusplus/multithreaded2B.html[^]
  Permalink  
v2
Comments
Albert Holguin at 1-Apr-11 10:15am
   
great tutorial for those using visual studio
Olivier Levrey at 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
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 8,284
1 Sergey Alexandrovich Kryukov 7,327
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,920


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 4 Apr 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100