This is a common problem. Even user mode code needing to query the
“perfomance counter” has no idea which core the value came from. Trying to
implement test threads with affinity leads to more delays and problems
making the exercise pretty worthless.
My question related to this is: Can the user pre-set the performance counter
(from user mode? or from kernel mode?). I am not thinking of trying to set
them all the same (though it would be nice) but if they could all be pre-set
to very different values, e.g each with a different top few bits, then
anyone reading them would be able to work out instantly which processor’s
counter they got, and easily build a map relating the processor cores after
a few tests.
Thanks, M
>>>>>>>>>>>>>>>>>>
----- Original Message -----
From: Tim Roberts
To: Windows System Software Devs Interest List
Sent: Tuesday, March 16, 2010 2:29 AM
Subject: Re: RE:[ntdev] Time measurements - rdtsc
You wrote:
Thank you for your answer. Could you briefly explain to me how with
invariant TSC, the cycle counters can vary between different cores?I thought that they will all share the same value somehow. I guess I
was wrong. Thanks.
No, even in a hyperthreaded processor (which is really only one core), each
processor has its own cycle counter.
The cycle counters are not synchronized at boot time, and the processors do
not come out of reset at the same exact instant.
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer