Re: How does a thread know what processor it is running on?
- From: "Slava M. Usov" <stripit.slough@xxxxxxx>
- Date: Fri, 26 Aug 2005 02:58:58 +0200
"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
.
- References:
- How does a thread know what processor it is running on?
- From: Gerry Suggitt
- Re: How does a thread know what processor it is running on?
- From: Skywing
- Re: How does a thread know what processor it is running on?
- From: Pavel A.
- How does a thread know what processor it is running on?
- Prev by Date: Re: Things that can bring down the OS?
- Next by Date: Re: List of available C library functions?
- Previous by thread: Re: How does a thread know what processor it is running on?
- Next by thread: Re: How does a thread know what processor it is running on?
- Index(es):
Relevant Pages
|