This question is not related to pinpointing accuracy in Windows (XP or higher), but rather about doing something very fast through a callback or interrupt .
I need to do something regularly every 1 millisecond, or preferably even every 100 microseconds. What I need to do is connect some asynchronous hardware (ethernet) at such a speed that I can output a constant stream of packets to the network and make the stream as regular and synchronous as possible. But if the question can be separated from the (ethernet) device, it would be nice to know the general answer.
Before saying “don't even think about using Windows !!!!”, a little context. Not all real-time systems have the same requirements. In most cases, songs and videos are played on Windows, despite the need to process blocks of audio or images every 10-16 m or more on average. With proper buffering, Windows can have its own delay variables, but the hardware can be generally immune to them and maintain a steady, synchronous stream of events. Despite this, most of us experience an accidental failure. My application looks like this - perhaps quite bearable.
An expensive option for me is to port my entire application to Linux. But Linux is just another software that runs on the same hardware, so my strong preference is to write better software and use Windows. I have the luxury of being able to eliminate all competing hardware and software (no Internet access or other network access, other applications not working, etc.). Do I have the prospect of getting Windows to do this? What restrictions have I encountered?
I know that my target equipment has a High Performance Event Timer and this timer can be programmed to interrupt, but there is no driver for this. Can i write it? Are there any useful examples? I haven't found it yet. Will this interfere with the QueryPerformanceCounter? Is the fact that I'm going to use an ethernet device mean that everything becomes simple if I use select () correctly?
Pointers to useful articles are welcome - I have found dozens of reviews on how to get the exact time, but not yet, how to do something similar, except to use what constitutes a lively expectation. Is there any way to avoid busy waiting? Is there a kernel mode or device driver option?
omatai
source share