🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #6283

Re: How to detect number of CPUs and hyperthreading?

#6283
From: SubZero
Date: Sun, 22 May 2005 07:03
42 lines
2260 bytes
Hi Gambit,

Thanks a lot for your answer. See below:

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:429012e6$1@newsgroups.borland.com...
>
> "SubZero" <g_ates@hotmail.com> wrote in message
> news:428f19db$1@newsgroups.borland.com...
>
>> I wish to get the number of CPUs
>
> GetSystemInfo()
>
>> whether they are hyper threading or multi-cored.
>
> You need to query each CPU directly, via the CPUID assembly instruction.
>
> You can use SetThreadAffinityMask() to specify which CPU a given thread 
> will
> execute on.  Calling CPUID with an EAX register value of 0x01 will return
> the CPU's version info in the EBX register.  Bits 16-23 of the EBX 
> register
> will specify the number of logical processors per physical processor. For 
> a
> hyper-threaded CPU, this value will be 2.
>
> I don't know how to identify dual-core CPUs.  Do note, however, that a
> dual-core CPU can also support hyper-threading as well.
>
> Go to Intel's website to download the manuals for the Pentium assembly
> instruction set for more details.
>

What about AMD? Shouldn't there be an API function that supports both?

Also, will Borland support 64-bit? Are binaries for AMD and Intel 64-bit are 
different or can they be the same?

Best Regards,

SZ 
Technical Details
Message-ID: <42902ea3@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <428f19db$1@newsgroups.borland.com> <429012e6$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,f023ae5d6b5f79c7
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "SubZero" <g_ates@hotmail.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <428f19db$1@newsgroups.borland.com> <429012e6$1@newsgroups.borland.com>
Subject: Re: How to detect number of CPUs and hyperthreading?
Date: Sun, 22 May 2005 10:03:05 +0300
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 85.99.188.174
Message-ID: <42902ea3@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1116745379 85.99.188.174 (22 May 2005 00:02:59 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail