views:

440

answers:

1

I'm running an application right now which seems to be running at full throttle, but even though the fan seems to be spinning at it's max and the activity monitor reports that the application is using 100% of the processor, I'm suspecting that at the most it is using 100% only of a single of the two cores on my machine.

How can I tell OS X to allow an application use 100%, or as much as the OS can allow, of the processing power of my computer? I have tried some terminal commands like "nice" and "renice" to set up the priority of this process but still can't get it to run at full throttle.

I also would like to know how to do the opposite, set a limit of the processor usage of an app, example set app X to run at 20%.

Is this possible to do without modifying the code of the app?

+2  A: 

The answer to this depends upon whether your application is multi-threaded or not. If this is a single-threaded application, which it is unless you have specifically made it multi-threaded then the process will run on one core of your multi-core hardware. There is nothing you can do about this it's a function of the underlying operating system.

If your program is multi-threaded then it is possible to have different threads executing on separate cores. This will increase the overall usage of the process and allow figures greater than 100%.

You can not however force the machine to use 'all' of the processing power available, but you can influence it with nice.

In order to reduce the amount of processor used then you can use nice to lower the priority of the process. If you are root you can also use nice to increase the priority of your process

Steve Weet
got it. what about the opposite? is it possible to put like an e-brake on an app to simulate it is running on a slower machine?Thanks for the answer.
avanrotciv