Archived

This topic is now archived and is closed to further replies.

hellfire

what is the way to create Threads in C++

Recommended Posts

I am going to multithread my app, what is the best way to convert my loops into threads in C++? I have done in Java but I am not as familiar with C++. Any tips and pointers on this subject would help me out. Thanks

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Win32: search for _beginthreadex in the MSDN.
Don''t use CreateThread or anything like that if you need the C/C++ run-time functions. You''ll see why if you check the MSDN.

Share this post


Link to post
Share on other sites
On windows take a look at _beginthreadex, WaitForSingleObject (and friends), CreateEvent (and friends). Also consider that converting a loop into a thread might not be the best approach to take at all due to the speed gains over Java that C++ provides.

Share this post


Link to post
Share on other sites