Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to limit number of CPU cores used by a Cocoa app



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >How to limit number of CPU cores used by a Cocoa app (From: Andre Schnoor <email@hidden>)
 >Re: How to limit number of CPU cores used by a Cocoa app (From: Chris Hanson <email@hidden>)
 >Re: How to limit number of CPU cores used by a Cocoa app (From: Chris Driggett <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.