Disabling all but one core

Posts: 156
Joined: 2002.10
Post: #1
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 ??


- Iain
Quote this message in a reply
Posts: 1,487
Joined: 2002.09
Post: #2
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.
Quote this message in a reply
Posts: 156
Joined: 2002.10
Post: #3
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:

nm /System/Library/PrivateFrameworks/CHUD.framework/Frameworks/CHUDCore.framework/CHUDCore | grep Processor

4b00568c T _chudLogicalProcessorCount
4b0056e8 T _chudMaxLogicalProcessorCount
4b0131d2 T _chudSetNumLogicalProcessors

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
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  OpenGL and Core Graphics efficiency / performance Elphaba 4 5,822 Aug 3, 2009 08:48 AM
Last Post: Skorche