Re: How to limit number of CPU cores used by a Cocoa app
Re: How to limit number of CPU cores used by a Cocoa app
- Subject: Re: How to limit number of CPU cores used by a Cocoa app
- From: Andre Schnoor <email@hidden>
- Date: Sun, 30 Dec 2007 13:33:07 +0100
Chris Driggett wrote:
Andre,
You can use the thread affinity tags. This will allow you to group
threads together. I had to do this since Mac OS X is expensive when
sharing common data across cpu dies.
Here is the link to the apple doc.
http://developer.apple.com/releasenotes/Performance/RN-AffinityAPI/index.html
Thanks. If I got it right, I can assign the same non-null affinity tag
to all threads and they will be run on the same CPU package, just like
on a Core 2 Duo. This should do it.
Obviously there's no way to set the affinity tag for a thread that is
already running. How is one supposed to set the affinity tag of a thread
that is about to be started with
#detachNewThreadSelector:toTarget:withObject: or even for the main
thread? I assume this is impossible.
Andre
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden