 |
 |
How to run an app on one processor only...
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2002
Location: Hilton Head, SC
Status:
Offline
|
|
Ie there a way to make different applications run on only one particular processor? Such as a gui solution? I won't turn command line strings down either... although a gui app that does it would be nice!
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status:
Offline
|
|
Originally posted by Tyler McAdams:
Ie there a way to make different applications run on only one particular processor? Such as a gui solution? I won't turn command line strings down either... although a gui app that does it would be nice!
Sure, you write the app as single-threaded.
By and large, process THREADS cannot run across multiple processors. Applications take advantage of multiple processors by dividing their work into multiple threads and letting the OS schedule the individual threads on any available processor.
One has to ask the question of why you want to do this, though...?
|
|
Gods don't kill people - people with Gods kill people.
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2002
Location: Hilton Head, SC
Status:
Offline
|
|
Originally posted by Camelot:
Sure, you write the app as single-threaded.
By and large, process THREADS cannot run across multiple processors. Applications take advantage of multiple processors by dividing their work into multiple threads and letting the OS schedule the individual threads on any available processor.
One has to ask the question of why you want to do this, though...?
Ok... let me put this differently... I have a XP pro dual AMD box at home... any application or process, smp aware or not, has an affinity setting that can be accessed by right clicking the process in the process window... the affinity window pops up and shows you a list of the available cpus... from there you can run *any* program from either both (which is default for an smp application obviously) cpu's or choose one cpu or the other... many times if I have encoding to do but still need to do something else on my box I can set the encoder to only one cpu and basically still work without taking a true hit in performance by using the other processor for word or IE or whatever... (still with me?) I'd like to be able to do the same while working on my mac... set a heavy program to my second cpu and work from the other... You can also change cpu utilization from "low" all the way up to "realtime" as well under the contextual window for processes. How the program is written has no barring on the affinity settings so you can effectivly chop a cpu away from an smp app or add more to it or switch a "regular" app to any other cpu that is ide... for servers with more than 2 cpus this is a big thing. I work as a mainframe analyst for IBM... our mainframes do the same thing but we use command line strings to set cpu utilization and other things like which cpu... so on and so forth... OS X being unix *should* have some kind of setting to pull this off... I just don't know the cmd...
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Dec 2001
Location: Promised Land
Status:
Offline
|
|
Originally posted by Tyler McAdams:
Ok... let me put this differently... I have a XP pro dual AMD box at home... any application or process, smp aware or not, has an affinity setting that can be accessed by right clicking the process in the process window... OS X being unix *should* have some kind of setting to pull this off... I just don't know the cmd...
Mach does have something simliar to processor affinity, but it is not enabled/useable in OS X. And really, you do not need it. OS X/Mach's scheduling is leagues better than XP, so just let Mach do its job and you won't have to worry about what processor your app is running on. Mach will make sure it gets as much time as it needs (while being fair to other apps).
BTW, OS X being Unix has nothing to do with processor affinity. In fact Unix has traditionally NOT supported affinity because it is meant to be a time-sharing OS. Only the high-end commercial Unices support affinity and that is because they can have 100's of CPU's.
As for process priority, you can change that if you want. Use the 'nice' command from Terminal ('man nice' for instructions).
HTH.
|
|
G5 2.5 DP/2GB RAM/NVidia 6800 Ultra
PowerBook Al 1Ghz/768MB RAM
6gb Blue iPod Mini
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2002
Location: Hilton Head, SC
Status:
Offline
|
|
Originally posted by someone_else:
Mach does have something simliar to processor affinity, but it is not enabled/useable in OS X. And really, you do not need it. OS X/Mach's scheduling is leagues better than XP, so just let Mach do its job and you won't have to worry about what processor your app is running on. Mach will make sure it gets as much time as it needs (while being fair to other apps).
BTW, OS X being Unix has nothing to do with processor affinity. In fact Unix has traditionally NOT supported affinity because it is meant to be a time-sharing OS. Only the high-end commercial Unices support affinity and that is because they can have 100's of CPU's.
As for process priority, you can change that if you want. Use the 'nice' command from Terminal ('man nice' for instructions).
HTH.
Ah... so priority can be changed but no affinity. interesting. OS X being unix, I know, has nothing to do with affinity, but I was looking for something to contrast it with and a 2.5 mil mainframe wasn't working... lol.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|