问题描述
我正在尝试Windows中的多线程,并且想知道是否应该
I'm experimenting with multithreading in Windows and was wondering whether I should
- 使用
- 使用
- use Win32 API
- use POSIX Threads for Windows
学习Pthreads如果我尝试在不同的平台上开发这样的应用程序 - 但是我没有学习Win32 API丢失什么?
Learning Pthreads would be useful if I tried to develop such applications on different platforms - but am I losing anything by not learning Win32 API? Or are both similar enough so that learning one allows me to figure out the other easily?
推荐答案
-
使用Boost线程。当C ++ 0x来时,我们将有std :: threads。
Use Boost Threads. When C++0x comes along, we will have std::threads. Boost threads has the closest implementation to std threads.
否则使用pthreads。 Pthreads是第二接近std :: threads,并形成std线程和boost线程的主要基础。
else use pthreads. Pthreads is second closest to std::threads, and formed the main basis of std threads and boost threads.
else do windows直接。你仍然可以学习线程如何工作,并形成一个心理模型的事情。它只是倾向于使用有点非标准的同步原语。
else do windows threading directly. You can still learn how threads work, and form a mental model of things. It just tends to use synchronization primitives that are a bit non-standard.
这篇关于Visual C ++中的Pthreads的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!