• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Determining if a user's comp has 2 processors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining if a user's comp has 2 processors


  • Subject: Re: Determining if a user's comp has 2 processors
  • From: email@hidden
  • Date: Sat, 8 Mar 2003 10:44:54 +0100

On samedi, mars 8, 2003, at 10:09 AM, Simone Manganelli wrote:

What's the best way to quickly figure out if the user's computer has 2 processors or not? Any suggestions would be great.

Maybe not the best way but one way:

#include <mach/mach.h>
#include <mach/mach_error.h>
#include <mach/machine.h>
#include <mach/mach_types.h>
#include <mach/processor_info.h>

kern_return_t error;
processor_info_array_t tArray;
natural_t tProcNumber;
mach_msg_type_number_t tProcessor_infoCnt;

error = host_processor_info(mach_host_self(),PROCESSOR_BASIC_INFO,&tProcNumber,& tArray,&tProcessor_infoCnt);

if (error == KERN_SUCCESS)
{
CPUNumber_=tProcNumber;

vm_deallocate( mach_task_self(), (vm_address_t)tArray, tProcessor_infoCnt );
}
else
{
mach_error("host_processor_info", error);
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >Determining if a user's comp has 2 processors (From: Simone Manganelli <email@hidden>)

  • Prev by Date: Re: Threaded data freaking out
  • Next by Date: Re: [code] Source code for a Time Control
  • Previous by thread: Determining if a user's comp has 2 processors
  • Next by thread: Re: Determining if a user's comp has 2 processors
  • Index(es):
    • Date
    • Thread