pthread and multiple CPU

N

noel.yim

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

Nelu

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).
 
K

Keith Thompson

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

tarunjs

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
 

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

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top