Pthreads in Visual C++

前端 未结 5 2049
小蘑菇
小蘑菇 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:41

    1. Use Boost Threads. When C++0x comes along, we will have std::threads. Boost threads has the closest implementation to std threads.

    2. else use pthreads. Pthreads is second closest to std::threads, and formed the main basis of std threads and boost threads.

    3. 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.

提交回复
热议问题