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,559 times
1
HostileFork says dont trust SE
- 32,056
- 10
- 97
- 159
Ali Ahmed
- 1,649
- 6
- 19
- 29
-
hmm why is this downvoted? just curious – tekknolagi Nov 16 '11 at 04:51
-
3Simply search it. http://msdn.microsoft.com/en-us/library/windows/desktop/ms682516.aspx – minjang Nov 16 '11 at 04:51
-
Why tagged c++? Do you want a c++ threading api or a c threading api? – Nov 16 '11 at 04:54
-
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
3 Answers
2
0
For windows: Use _beginthread and _beginthreadex. CreateThread has problems with the CRT.
For unix: use pthread_create
chacham15
- 13,146
- 24
- 95
- 197
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
- 332
- 2
- 9