Re: How does a thread know what processor it is running on?



"Pavel A." <pavel_a@xxxxxxxxxxxxxxx> wrote in message
news:%23SSOFEdqFHA.616@xxxxxxxxxxxxxxxxxxxxxxx
> "Skywing" <skywing_NO_SPAM_@xxxxxxxxxxxxxxxxxxx> wrote in message
> news:e5hgdBaqFHA.364@xxxxxxxxxxxxxxxxxxxxxxx
>> Well, it could change at any time, so that's really only useful for
>> performance gathering. If you're on Win2003 or later, you
>> can GetCurrentProcessorNumber().
>
> and if you are not on win2003 - use cpuid instruction.
> Processor is identified by it's local apic id and CPU index
> (logical CPUs of HT processor have same APIC id).

But you still can distinguish them via cpuid -- this was discussed here a
while ago.

> The cpuid app note on intel site has all relevant details.

CPU can also be differentiated by their IDTs, which also has been discussed
here.

> The problem is that the code sequience for cpuid is not
> atomic, so CPU can switch in the middle...

Who cares, the result hardly means anything anyway.

S


.



Relevant Pages

  • Re: GetCurrentProcessorNumber() for XP?
    ... You would set the affinity for each processor in sequence to build a mapping ... Then, later, when you execute cpuid on a thread with multiprocessor ... I think the problem being discussed (custom CPU meter ...
    (microsoft.public.win32.programmer.kernel)
  • Re: 2.6.28 boot fails on Cyrix 6x86
    ... Enabling CPUID on Cyrix processor. ... 45680k/49152k available (1557k kernel code, 3084k reserved, ... CPU: Cyrix 6x86 2x Core/Bus Clock stepping 05 ...
    (Linux-Kernel)
  • 2.6.28 boot fails on Cyrix 6x86
    ... UMC UMC UMC UMC ... Enabling CPUID on Cyrix processor. ... CPU: Cyrix 6x86 2x Core/Bus Clock stepping 05 ...
    (Linux-Kernel)
  • Re: 2.6.28 boot fails on Cyrix 6x86
    ... UMC UMC UMC UMC ... Enabling CPUID on Cyrix processor. ... CPU: Cyrix 6x86 2x Core/Bus Clock stepping 05 ...
    (Linux-Kernel)
  • Re: D M=CPU - What is a N CPU
    ... ID CPU VF CF SERIAL ... cpuid s s s ser_no ... For IBM-MAIN subscribe / signoff / archive access instructions, ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ...
    (bit.listserv.ibm-main)

Quantcast