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: Discover multiple processors programmatically?



On Dec 16, 2005, at 8:24 PM, Ivan S. Kourtev wrote:

Is there an API that would allow me to discover the availability of more then one physical processor cores? If so, is it somewhat standard -- would it work on say, Linux? I am parallelizing an application and would like to have two- and four-processor versions of some computationally intense code.

Anyone know of such an API, particularly one that is someone platform-independent?

There are a number of APIs that'll return the number of processors. The most basic BSD-level one is the hw.ncpu sysctl, which you can access either by name or by number (CTL_HW/HW_NCPU).


I'm not aware of any cross-platform API to get this information, but if anyone else knows of one I'd be interested in hearing about it.

-Eric

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/unix-porting/email@hidden

This email sent to email@hidden
References: 
 >Discover multiple processors programmatically? (From: "Ivan S. Kourtev" <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.