parallel computing in C++

C

carlosp

I am programing something that could greatly benefit from parallel
computing in C++, in parts of the program, where user defined classes
are passed. I have googled but I cannot find the proper tool. Any
experienced programmer could give me a hint, namely some good
keywords?


Thanks!
 
I

Ian Collins

carlosp said:
I am programing something that could greatly benefit from parallel
computing in C++, in parts of the program, where user defined classes
are passed. I have googled but I cannot find the proper tool. Any
experienced programmer could give me a hint, namely some good
keywords?

You don't have a ask twice!

Look for openMP.
 
R

Rui Maciel

carlosp said:
I am programing something that could greatly benefit from parallel
computing in C++, in parts of the program, where user defined classes
are passed. I have googled but I cannot find the proper tool. Any
experienced programmer could give me a hint, namely some good
keywords?

What's wrong with pthreads?


Rui Maciel
 
R

Rui Maciel

Jeff said:
It's very low-level, and does not provide most of the tools one need for
real-world parallel processing: thread pools

Isn't that a common design pattern that is easy to implement?
data structures that
support concurrent access

What's wrong with mutexes and read-write locks?



Rui Maciel
 
C

Chris M. Thomasson

Rui Maciel said:
Isn't that a common design pattern that is easy to implement?

Of course.



What's wrong with mutexes and read-write locks?

Nothing. However, if your looking for extremely scaleable high-performance
data-structures, well... That's another story... Perhaps best discussed over
on `comp.programming.threads'.
 
C

Chris M. Thomasson

Jeff Schwab said:
Not really.

You can create full-blown lock-based work-stealing schedulers in POSIX that
have pretty darn good scalability. Wait-free work-stealing algorithms are
another story... Here is a pretty good one:

http://groups.google.com/group/comp.programming.threads/browse_frm/thread/8ad297f61b369a41



In particular, assigning tasks to threads at random kills cache coherency
and performance.

That depends on several factors. Anyway, a simple way to get good cache
performance is to batch up similar actions together and execute them all on
a single CPU:

http://www.usenix.org/events/usenix02/full_papers/larus/larus.pdf



You can write "a thread pool," but it takes multiple person-months to get
something competitive with COTS solutions.

Sometimes. Intel TBB and Clik++ are both based on work-stealing, and those
algorihtms are not rocket science, IMVHO of course...
 
C

Chris M. Thomasson

Chris M. Thomasson said:
Sometimes. Intel TBB and Clik++ are both based on work-stealing, and those
algorihtms are not rocket science, IMVHO of course...


However, COTS are OH SO CONVENIENT. AFAICT, Intel TBB is a very good choice.

:^)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top