Set cpu affinity for a process

raghu2383

Registered
Hello everyone,

I am new to the world of Mac. I have access to a MAC Darwin 10.3 Intel 8 core machine over remote without any GUI access. I need to run multiple CPU intensive programs on it. Is there a way I can lock a process to a processor. For example I would like to execute process A on core 0, Process B on core 1, etc. The reason to do this is that it gives better cache performance and a host of other things.

In Linux it is easy to do it: we open the command line and type:
taskset -c <cpuno> <Program name>

Is there an easy way to do it in MAC using command line as I have no access to the GUI.

Thanks in advance.

RS
 
At it's core OS X is just a slightly modified FreeBSD, so you could try figuring out how it's done in *BSD land. Of course one of the big benefits of 10.6 over 10.5 is Grand Central Dispatch. Which is basically a daemon that monitors CPU/core load levels and tries to distribute system load as evenly as possible. It's basically like an automatic version of what you want to do. It should Just Work(tm) and not depend on the GUI in any way.
 
Back
Top