I am using Visual studio in windows for developing C library. Can someone please provide me simple example of creating thread in windows console application and starting it. Thanks
Asked
Active
Viewed 4,793 times
1

HostileFork says dont trust SE
- 32,904
- 11
- 98
- 167

Ali Ahmed
- 1,749
- 6
- 20
- 29
-
3Simply search it. http://msdn.microsoft.com/en-us/library/windows/desktop/ms682516.aspx – minjang Nov 16 '11 at 04:51
-
C don't have any thread ...its os has...you are looking for windows thread then upper link is good – Jeegar Patel Nov 16 '11 at 04:58
-
2possible duplicate of [How to use threads in C on Windows?](http://stackoverflow.com/questions/1981459/how-to-use-threads-in-c-on-windows) – HostileFork says dont trust SE Nov 16 '11 at 05:48
-
Which compiler / libraries are you using? – David Heffernan Nov 16 '11 at 07:48
-
These links may help you. **[Creating Threads](http://msdn.microsoft.com/en-us/library/windows/desktop/ms682516%28v=vs.85%29.aspx)** **[Thread Functions](http://msdn.microsoft.com/en-us/library/windows/desktop/ms684847%28v=vs.85%29.aspx#thread_functions)** – Thomas Nov 16 '11 at 15:32
2 Answers
0
For windows: Use _beginthread and _beginthreadex. CreateThread has problems with the CRT.
For unix: use pthread_create

chacham15
- 13,719
- 26
- 104
- 207
0
C++ and C doesn't have support for Threads. You have to use Win32 APIs for threading support for which you can google,BING.

Praveen
- 331
- 2
- 9