开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜