Is there any good introduction books on C++multithread programming

Discussion in 'C++' started by QQ, May 17, 2005.

  1. QQ

    QQ Guest

    I am new here and got lost on a multithread C++ system
    source codes

    Thanks a lot!
     
    QQ, May 17, 2005
    #1
    1. Advertisements

  2. You should ask in comp.programming.threads. C++ does not
    have any mechanisms for multithreading, it's all part of the
    platform/OS you're on.

    V
     
    Victor Bazarov, May 17, 2005
    #2
    1. Advertisements

  3. QQ

    Phlip Guest

    Are you reading that source to learn? Are you on the job and must change it?
    Or are you writing a new program with threads?

    From the top: C++ does not define any Standard thread functions. Every
    implementation of C++ is different, and exposes various different OS
    threading facilities. To learn from existing source, or change it, you must
    research only the specific threading library (ZThread?) involved. They are
    all different, and a generic introductory book might not cover your library.

    If you are writing a new program, don't thread. Always start with a fully
    event-driven design, so you won't need threading for as long as possible.
    Make sure all your long processes are interruptible. Don't write a loop
    statement if you can store its index in a data member and loop from driver
    code.

    Premature threading can lead to a bad design - and simply horrible bugs as
    the threads conflict over resoures. An event driven design, however,
    typically forces your program to use a clean and healthy object model. This
    makes threads easy and safe to retrofit if you then find a real reason for
    them.
     
    Phlip, May 17, 2005
    #3

  4. Actually having hit the clock speed enhancement wall and getting multicore processors, we
    must thread as much as possible.


    http://www.gotw.ca/publications/concurrency-ddj.htm
     
    Ioannis Vranos, May 18, 2005
    #4
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.