Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > pthread and multiple CPU

Reply
Thread Tools

pthread and multiple CPU

 
 
noel.yim@gmail.com
Guest
Posts: n/a
 
      03-07-2006
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.

 
Reply With Quote
 
 
 
 
Nelu
Guest
Posts: n/a
 
      03-07-2006

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

 
Reply With Quote
 
 
 
 
Keith Thompson
Guest
Posts: n/a
 
      03-07-2006
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) kst- <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.
 
Reply With Quote
 
tarunjs@gmail.com
Guest
Posts: n/a
 
      03-08-2006
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

 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      03-08-2006
"" <> 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) kst- <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.
 
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
pthread and opengl Leon C++ 4 02-11-2008 08:51 AM
using pthread to create threads, and my application hogs on memory sharekhan C++ 1 02-03-2007 07:35 PM
Again: STL map and pthread performance problem on Linux/GCC Alexander Kotelnikov C++ 7 11-23-2006 02:07 PM
STL map and pthread performance problem on Linux/GCC nan.li.g@gmail.com C++ 9 08-18-2005 03:26 PM
using pthread to receive data on a socket and simultaneously play it using /dev/dsp kanchan C Programming 1 11-13-2004 10:33 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57