Click here to Skip to main content
15,868,292 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We are trying to call a watchdog function every 500ms using timeSetEvent.

Normally the watchdog is called without any problems. However when a DVD is inserted into a drive I don't get a callback for up to 8 secs. Using WindowsQueue times things aren't quite so bad and I get a 4 second day.

My last attempt was to set thread priority to time critical and then sleep for 500ms, but again the callback didn't occur for 8secs.

I am still running XP, but I'm not aware of changes made in later operating systems which would make this better.

I am using the DVD insertion as an example. I'd like the code to be robust to other conditions if possible.

Any suggestions greatly appreciated.
Posted

1 solution

Instead of pretending accurate timing, I would measure, in the watchdog routine, the CPU time of the process.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900