开发者

How to: Threading on windows platform (C++)

开发者 https://www.devze.com 2023-01-19 05:23 出处:网络
I shall like to know how to use threading on windows platform. Do I need to include some lib or dll file? Is there some comman开发者_JAVA技巧d?I\'d use Boost.Thread, with which you gain portability as

I shall like to know how to use threading on windows platform. Do I need to include some lib or dll file? Is there some comman开发者_JAVA技巧d?


I'd use Boost.Thread, with which you gain portability as well as ease of use.


The Windows API (Win32) includes a number of threading tools.

  • http://msdn.microsoft.com/en-us/library/ms684852%28v=VS.85%29.aspx

Since you tagged this as C++ and not C, you might however consider using something more elaborate like just::thread (or std::thread if your compiler supports it) or Boost.Thread like usta suggested.


Use the general CRT/ Windows API handles & functions (_beginthread, _beginthreadex, etc.) or MFC classes, like this example.


for documentation regarding C++ 0x threads standard that is also portable (works on any platform) you can also have a lokk here: http://accu.org/var/uploads/journals/overload93.pdf (see article multi-threading in C++0x)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号