Pthreads in Visual C++

前端 未结 5 2048
小蘑菇
小蘑菇 2021-01-02 06:57

I\'m experimenting with multithreading in Windows and was wondering whether I should

  • use Win32 API
  • use POSIX Threads for Windows

Learni

5条回答
  •  感动是毒
    2021-01-02 07:45

    I've found that sticking with pthreads saves my sanity on three counts:

    • I don't have to fight through WinAPI docs, which aren't habitually of any quality.
    • Anyone that does much with threads can help out with pthreads. I've found infinitely more good sources of information about pthreads online.
    • Whenever I implement anything more complicated that "Hello World" with the WinAPI, I find it takes far longer than one could reasonably expect. That's just my empirical input, though.

    As far as capabilities are concerned, I've never found pthreads to be lacking in anything, so I don't think I've ever found the need to look elsewhere. There is also a great deal to be said for learning a library that you'll be able to use in any environment you tackle.

提交回复
热议问题