Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > parallel computing in C++

Reply
Thread Tools

parallel computing in C++

 
 
carlosp
Guest
Posts: n/a
 
      04-25-2009
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!
 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      04-25-2009
carlosp wrote:
> 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.

--
Ian Collins
 
Reply With Quote
 
 
 
 
Juha Nieminen
Guest
Posts: n/a
 
      04-26-2009
Ian Collins wrote:
> Look for openMP.


This is a good tutorial for those fluent in C++:

http://bisqwit.iki.fi/story/howto/openmp/
 
Reply With Quote
 
Rui Maciel
Guest
Posts: n/a
 
      04-26-2009
carlosp wrote:

> 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

 
Reply With Quote
 
Rui Maciel
Guest
Posts: n/a
 
      04-27-2009
Jeff Schwab wrote:

> 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

 
Reply With Quote
 
Chris M. Thomasson
Guest
Posts: n/a
 
      04-28-2009
"Rui Maciel" <(E-Mail Removed)> wrote in message
news:49f63d4b$0$29372$(E-Mail Removed)...
> Jeff Schwab wrote:
>
>> 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?


Of course.




>> data structures that
>> support concurrent access

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

 
Reply With Quote
 
SaticCaster
Guest
Posts: n/a
 
      04-28-2009
OpenMP Parallel Programming
http://www.viva64.com/links/parallel-programming/
 
Reply With Quote
 
Chris M. Thomasson
Guest
Posts: n/a
 
      04-28-2009
"Jeff Schwab" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ...
> Chris M. Thomasson wrote:
>> "Rui Maciel" <(E-Mail Removed)> wrote in message
>> news:49f63d4b$0$29372$(E-Mail Removed)...
>>> Jeff Schwab wrote:
>>>
>>>> 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?

>>
>> Of course.

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




> 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/usenix0...arus/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...

 
Reply With Quote
 
Chris M. Thomasson
Guest
Posts: n/a
 
      04-28-2009
"Chris M. Thomasson" <(E-Mail Removed)> wrote in message
news:gt7o07$1qgm$(E-Mail Removed)...
> "Jeff Schwab" <(E-Mail Removed)> wrote in message
>>
>> 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...



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

:^)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Optical Computing: special issue - Natural Computing, Springer optical supercomputing C Programming 0 01-16-2009 12:18 PM
Optical Computing: special issue - Natural Computing, Springer optical supercomputing C Programming 0 12-19-2008 12:22 PM
Call for Papers: The2007 International Conference of Parallel and Distributed Computing (ICPDC 2007) imecs_2007@iaeng.org Java 0 01-22-2007 09:17 AM
Razer Tarantula Gaming Keyboard Review at XYZ Computing at XYZ Computing Silverstrand Front Page News 0 11-01-2006 05:13 PM
parallel computing Sori Schwimmer Python 0 04-25-2006 07:02 PM



Advertisments