|
-
June 3rd, 2002, 02:34 PM
#1
Question about Threads and CPU's...
Question about Threads. I'm programming on a quad processor solaris box. My question is how do my cpu's get scheduled? Are they scheduled by process or by thread.
Meaning when I'm running a single multithreaded process does my program take advantage of the multi processors? Or do I need to run multi-processes to saturate these cpu's?
-
June 25th, 2002, 03:44 AM
#2
It is one processor per process. Threads are meant to be light-weight (LWP) so they all share the same processor.
Succinct is verbose for terse
-
June 25th, 2002, 11:48 AM
#3
I actually asked this question quite some time ago. During off line research this is what I discovered.
Solaris has what is called kernel level threads which are scheduled across cpu's depending upon what activity is being done on the box. The os itself will try to optimize this, so if you've got four processors and four processes cross execution on the processors wont occur, but if you have one process with many threads the scheduler is likely to cross execute. Linux also has kernel level threads.
HP/UX does not have kernel level threads and I was not able to determine conclusively one way or the other about NT.
So it depends on the OS if threads in the same process are executed on different processors.
-
June 25th, 2002, 12:19 PM
#4
That's strange: when I was running a huge multi-threaded process, only one processor was used. All the others stayed idle. This happened on both Solaris 2.6 and HPUX 11. Things may have changed since I last looked at it (2000)
Succinct is verbose for terse
-
June 25th, 2002, 01:36 PM
#5
Hp-ux that's what I've found too. But 2.6 should have spead the load out. I'll try to dig up my documentation on this. I wouldn't mind learning I've been informed incorrectly on this.
How did you determine your other cpu's were not involved in solaris?
-
June 26th, 2002, 12:44 AM
#6
No documentation to back this up. I just looked at the processor graphs. There was a command to let you see what each processor was doing but I can't remember what it is since I haven't used multi-processor Suns for some time. Whenever I ran a multi-threaded program, one processor would shoot up but the others just remained flat.
Succinct is verbose for terse
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|