In the following piece of code,
------------------CRITICAL Section Begin -------------------------
startTimer1
Delay(5 milliseconds) // I know this works
startTimer2
Delay(5 milliseconds) // I know this works
startTimer3
-------------------CRITICAL Section End -----------------------
if you want startTimer2 to start exactly 5 millisecs after startTimer1,
then you should ensure that
(a) There are no interrupts inbetween. (U can ensure by placing this
critical code inbetween a CLI and STI assembly code)
(b) There are no NMI. ( On IBM PC, one of the o/p pin of the TIMER chip
is connected to the NMI.
By programming the timer chip is a certain way, you can make the
TIMER chip raise a NMI on some conditions.
So check if something like that is happening on your system.)
(a) and (b) both are must!
RDTSC counter can never be screwed up by the OS.
Cheers
Kiran
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Manohara.K
Sent: Monday, August 09, 2004 5:09 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Window Timers
Hi Experts!!
I have tried all kinds of Timers on Windows and I was not able to get a
Time
Function fired at 5 ms exactaly even though
DDK documentation says that the granualrity for Timer is in nano
seconds/Milli seconds in case of NDISMSetTimer/KeTimer.
Iam using the following technique ot get a “Window” of 5 milli Seconds.
Please tell if its in any ways usefull!!
Using RDTSC , I measure the cycles and compute the number of cycles
required
for 4 milli seconds.
I have a routine which doess some junk operations and gives me delay of
4
milliseconds
(I know this works with 99 % accuracy…after lot of testing).
I have a 2.6 GHz intel p4 with HT - Win 2000.So after testing all these
timers I know that the minimum scheduling time is 15 ms
(even though I set a timer for 5 ms
) .
I start 3 timers like this "
…
…
Initialize Timers
…
startTimer1
Delay(5 milliseconds) // I know this works
startTimer2
Delay(5 milliseconds) // I know this works
startTimer3
…
…
So logically I should get a timer running every 5 milliseconds.
Anybody please !! tell me if the OS would screw up the time gap ??
Any Ideas on how to get a code running every 5 milliseconds.??
Thanx in Advance
Regards,
Manohara
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@wipro.com
To unsubscribe send a blank email to xxxxx@lists.osr.com