Disabling all but one core
Hi all,
I've been playing around with my old copy of Myst III, and remarkably, it runs fine through Rosetta on 10.6!
However, the sound is a bit stuttery, which seems to be something to do with having a multi-core machine. If I turn off all cores but one (using the /Library/Application Support/HWPrefs/CPUPalette utility) then everything is nice and smooth. What I'd like to be able to do is to turn cores on or off programmatically, or from a script, so I could write a little app that could do this, launch the game, then turn them all back on again. But I can't find an Obj-C API that would allow this, or anything in the UNIX APIs.
Anyone got any ideas how this can be done - which it evidently can be as the utility does it ??
Cheers
- Iain
I've been playing around with my old copy of Myst III, and remarkably, it runs fine through Rosetta on 10.6!
However, the sound is a bit stuttery, which seems to be something to do with having a multi-core machine. If I turn off all cores but one (using the /Library/Application Support/HWPrefs/CPUPalette utility) then everything is nice and smooth. What I'd like to be able to do is to turn cores on or off programmatically, or from a script, so I could write a little app that could do this, launch the game, then turn them all back on again. But I can't find an Obj-C API that would allow this, or anything in the UNIX APIs.
Anyone got any ideas how this can be done - which it evidently can be as the utility does it ??
Cheers
- Iain
I seem to remember that one of the CHUD tools used to let you do that a few years ago. Though when I look in the CHUD folder, there are only like 2 programs there now.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Just in case anyone ever stumbles across this post, the utility in question is CPUPalette, which lives in /Library/ApplicationSupport/HWPrefs/
However, I also figured out how to do this in code - there are a bunch of functions you can call in Apple's CHUD.framework:
And plenty of other bits if you wanted to enable or disable individual cores etc.
I've posted my little app on my website http://www.pyramid-productions.net/softw...uncher.php.
There's a little extra subtlety that if you do not have CHUD installed (i.e. running on a machine without Developer Tools), you need to insert the CHUDKernLib and CHUDUtils kernel modules before calling any of the above functions.
Hope someone finds this useful!
- Iain
However, I also figured out how to do this in code - there are a bunch of functions you can call in Apple's CHUD.framework:
Code:
nm /System/Library/PrivateFrameworks/CHUD.framework/Frameworks/CHUDCore.framework/CHUDCore | grep Processor
4b00568c T _chudLogicalProcessorCount
...
4b0056e8 T _chudMaxLogicalProcessorCount
...
4b0131d2 T _chudSetNumLogicalProcessorsAnd plenty of other bits if you wanted to enable or disable individual cores etc.
I've posted my little app on my website http://www.pyramid-productions.net/softw...uncher.php.
There's a little extra subtlety that if you do not have CHUD installed (i.e. running on a machine without Developer Tools), you need to insert the CHUDKernLib and CHUDUtils kernel modules before calling any of the above functions.
Hope someone finds this useful!
- Iain

