What about TBB ? It is portable and has easy-to-use parallel template templates, parallel containers, a task scheduler, and scalable memory assistants. TBB allows you to directly control the flows, but this is not necessary in most cases.
Personally, I would stay away from specific threads on the platform, if there was no urgent need to do something, well, a specific platform.
Boost streams are portable and easy to use, but have neither parallel patterns nor parallel containers. You will need to manage the threads manually, which can become ugly pretty quickly.
PThreads is not available on Windows and its C. You really want multithreading in C ++, not C. RAII goes well with mutexes and fixed locks.
Another option is PPL in Visual C ++ 2010. It is similar to TBB, but, as you can assume, it is available only for Windows.
OpenMP is easy to use but not very flexible. Since you already learned C ++, you should use something more serious, like TBB or PPL. For some strange reason, Visual C ++ 2010 does not support OpenMP 3. Too bad.
source share