parallel computing in C++

Discussion in 'C++' started by carlosp, Apr 25, 2009.

  1. carlosp

    carlosp Guest

    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!
     
    carlosp, Apr 25, 2009
    #1
    1. Advertising

  2. carlosp

    Ian Collins Guest

    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
     
    Ian Collins, Apr 25, 2009
    #2
    1. Advertising

  3. Juha Nieminen, Apr 26, 2009
    #3
  4. carlosp

    Rui Maciel Guest

    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
     
    Rui Maciel, Apr 26, 2009
    #4
  5. carlosp

    Rui Maciel Guest

    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
     
    Rui Maciel, Apr 28, 2009
    #5
  6. "Rui Maciel" <> wrote in message
    news:49f63d4b$0$29372$...
    > 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'.
     
    Chris M. Thomasson, Apr 28, 2009
    #6
  7. carlosp

    SaticCaster Guest

    SaticCaster, Apr 28, 2009
    #7
  8. "Jeff Schwab" <> wrote in message
    news:...
    > Chris M. Thomasson wrote:
    >> "Rui Maciel" <> wrote in message
    >> news:49f63d4b$0$29372$...
    >>> 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.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...
     
    Chris M. Thomasson, Apr 28, 2009
    #8
  9. "Chris M. Thomasson" <> wrote in message
    news:gt7o07$1qgm$...
    > "Jeff Schwab" <> 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.

    :^)
     
    Chris M. Thomasson, Apr 28, 2009
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sori Schwimmer

    parallel computing

    Sori Schwimmer, Apr 25, 2006, in forum: Python
    Replies:
    0
    Views:
    334
    Sori Schwimmer
    Apr 25, 2006
  2. Replies:
    0
    Views:
    434
  3. Replies:
    0
    Views:
    357
  4. optical supercomputing

    Optical Computing: special issue - Natural Computing, Springer

    optical supercomputing, Dec 19, 2008, in forum: C Programming
    Replies:
    0
    Views:
    433
    optical supercomputing
    Dec 19, 2008
  5. optical supercomputing

    Optical Computing: special issue - Natural Computing, Springer

    optical supercomputing, Jan 16, 2009, in forum: C Programming
    Replies:
    0
    Views:
    457
    optical supercomputing
    Jan 16, 2009
Loading...

Share This Page