views:

708

answers:

5

Hi,

I am familiar with concurrent programming in Java which provides a lot of tools for this. However, C++ concurrent programming isn't so easy to start using.

What is the best way to start programming concurrently on C++? Are there any nice libraries which wrap concurrent programming primitives and provide you with more high-level constructs?

I tried QtConcurrent which provides you with nice MapReduce functionality but it is heavily biased towards concurrent computation using Qt so it's not a good choice if you don't want to use Qt.

Are there any other similar libraries? What do people use here?

Thanks for your help in advance, sneg

+3  A: 

You could look at CSP, which has a C++ implementation. Way different from Java's threading primitives, though.

Morendil
+4  A: 
MadKeithV
OpenMP is higher level than threads.
Jérôme
Yes, you're right - with OpenMP the developer doesn't have to worry about actual threads. It's a parallelism library rather than a threading library.
MadKeithV
+2  A: 

This question along with the answers can probably help you a little bit.

Anonymous
+10  A: 

There are several choices:

ACE which provides some concurrency constructs

Intel Threading Building Blocks

boost::threads

OpenMP

Qt Threading libraries

Douglas Leeder
Add QT (http://doc.trolltech.com/4.5/threads.html) to the list
lothar
+1  A: 

Intel's Threading Building Blocks is great for introducing concurrency at the level of individual data-parallel loops, and it takes care of managing threads and allocating work automagically. It can be used in similar ways to OpenMP, but without the need for explicit compiler support.

Simon C.