Search code examples
c++windowsmultithreadingpthreadsvisual-c++-2005

Pthreads in Visual C++


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

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?


Solution

    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.