pthread and multiple CPU

Discussion in 'C Programming' started by noel.yim@gmail.com, Mar 7, 2006.

  1. Guest

    Hi,

    First question is:
    I want to assign 8 threads to 8 processors (must one to one), when I
    initialize the thread, does it guarantee that each CPU has one thread?
    or there can be some case such that 4 threads on one process and other
    4 thread on 4 processors and 3 processors have no threads at all?

    Second question is:
    For instance, one processor has 4 jobs running, is it possible to shift
    2 of them to other processors? using IPC stuffs? or other methods?


    For the above questions, is there any reference links that I can visit?
    I am new to threading. Thanks ahead to anyone answer my questions.
     
    , Mar 7, 2006
    #1
    1. Advertising

  2. Nelu Guest

    wrote:
    > Hi,
    >
    > First question is:
    > I want to assign 8 threads to 8 processors (must one to one), when I
    > initialize the thread, does it guarantee that each CPU has one thread?
    > or there can be some case such that 4 threads on one process and other
    > 4 thread on 4 processors and 3 processors have no threads at all?
    >
    > Second question is:
    > For instance, one processor has 4 jobs running, is it possible to shift
    > 2 of them to other processors? using IPC stuffs? or other methods?
    >
    >
    > For the above questions, is there any reference links that I can visit?
    > I am new to threading. Thanks ahead to anyone answer my questions.


    This is off-topic here. You should ask in a group that's specific to
    your OS or to the threading mechanism you're using (I guess it's Linux
    or POSIX for pthread).

    --
    Ioan - Ciprian Tandau
    tandau _at_ freeshell _dot_ org (hope it's not too late)
    (... and that it still works...)
     
    Nelu, Mar 7, 2006
    #2
    1. Advertising

  3. writes:
    > First question is:
    > I want to assign 8 threads to 8 processors (must one to one), when I

    [...]

    Standard C doesn't support threads. Try comp.programming.threads.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
     
    Keith Thompson, Mar 7, 2006
    #3
  4. Guest

    Scheduling algoriths are OS specific, so I guess there is little you as
    an application programmer do to allocate a particluar thread to a
    particluar CPU
     
    , Mar 8, 2006
    #4
  5. "" <> writes:
    > Scheduling algoriths are OS specific, so I guess there is little you as
    > an application programmer do to allocate a particluar thread to a
    > particluar CPU


    Threads in general are OS specific; comp.programming.threads would be
    a better place to discuss them.

    And please read <http://cfaj.freeshell.org/google/>.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
     
    Keith Thompson, Mar 8, 2006
    #5
    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. kanchan
    Replies:
    1
    Views:
    854
    Karthik Kumar
    Nov 13, 2004
  2. Replies:
    9
    Views:
    601
  3. Alexander Kotelnikov
    Replies:
    7
    Views:
    2,058
    Mathias Gaunard
    Nov 23, 2006
  4. sharekhan
    Replies:
    1
    Views:
    396
    Ian Collins
    Feb 3, 2007
  5. pavunkumar

    How , system cpu and user cpu times calculates

    pavunkumar, Feb 27, 2009, in forum: C Programming
    Replies:
    1
    Views:
    376
Loading...

Share This Page