Re: howto get the number of cpu's
Re: howto get the number of cpu's
- Subject: Re: howto get the number of cpu's
- From: Lawrence Gold <email@hidden>
- Date: Tue, 21 Nov 2006 10:36:21 -0700
- Resent-date: Tue, 21 Nov 2006 10:36:43 -0700
- Resent-from: Lawrence Gold <email@hidden>
- Resent-message-id: <email@hidden>
- Resent-to: Xcode Users <email@hidden>
On Nov 21, 2006, at 10:17 AM, email@hidden wrote:
sorry if this is off topic
but how do i do this in a simple mach-0
just using system and coreservices
--
met vriendelijke groeten
perry winkel
www.perry7.nl
This works for me:
int mib[2];
int numCPUs = 1;
size_t len = sizeof(numCPUs);
mib[0] = CTL_HW;
mib[1] = HW_NCPU;
sysctl(mib, 2, &numCPUs, &len, 0, 0);
After the sysctl() call, numCPUs contains the number of CPU cores.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden