Quote:Original post by Codeka
If you really do need a precise 1ms update rate, then perhaps you shouldn't be trying to run on a general-purpose operating system. It may be that it's "worse" than it was in previous versions of the operating system, but I'm quite sure Microsoft didn't just change the rules for the sake of it. More than likely they've adjusted the scheduler to make the system fairer in the general case. The general case does not require clock-tick precise timing. Multimedia applications do not require precise timing, within 15-20ms (and maybe more) is good enough to avoid jitter.
I'd say that if you've got unusual requirements (and, to be honest, your requirements are unusual) then you're probably not best served running on a general purpose OS. You're probably better off looking into Linux and customizing the kernel for your particular needs.
If you really need to run on Windows, then you're kind of out of luck... you'll just have to figure out a way around the OS's design. I realise your post is more of a rant than anything, but what did you expect? There's not much we can do to help you, since we've got as much input into the design of the Windows scheduler as you do: none at all [wink]
Touche, but there *is* something better to be done.
My rant was specifically why the performance of Sleep has gotten /worse/ over the years - as the NT kernel has been updated and substantially improved in many, many ways from NT 3.5 to 7 why on Earth would the performance of Sleep degrade? It doesn't make sense and there actually *is* a reason!
There's a new feature called 'Timer Coalescing' the deliberately bunches timer expirations together (designed to minimize power consumption.)
Our software simulates and tests the software that runs vehicle ECUs (electronic control units). Primarily automotive but some military controllers as well.
Our 'software-in-the-loop' solution can run at "warp speed" and runs much faster than real-time (which is useful for getting 4 hours of testing done in 20 minutes).
Now given that we can do that... why is it so freaking hard to *slow it down* to real-time?
You can then interface a mix of real-hardware and virtualized hardware with a DAQ (analog IO, digital IO, maybe some counter/timers) and a CAN network device (CAN is most common type of network that runs [most] vehicles.)
i.e. The "vision" we sell is full-vehicle virtualization at the onset of the project and as hardware becomes available the virtual ECUs are replaced by real-ones and the same set of automated regression tests run on both the SIL & HIL environment.
Generally vehicles ECUs periodically tick from 1 to 10 ms. If one tick is 900us and the next is 1100us that is OK for simulation purposes as long as the over-all average is roughly 1000Hz. +/- 10% is tolerable and even an occasional delay spike is undesirable but again tolerable as long as it nominally runs at 1000Hz.
We can also "co-simulate" between disparate software development systems. The most pointed example is we can make a Statemate model "talk" to a Simulink model running on virtual ECUs. [This is "exciting" to companies using Statemate since it's a dead product and we give them a path forward to Simulink.]
So right now we burn up a core spinning hard calling QPC and it signals an event at a nominal rate of 1000Hz. What a terrible waste of 3GHz.
All of the "timing problems and issues" you have with SIL to HIL and between multiple virtualization computers are /same problems/ you have in the vehicle with multiple ECUs each having their own free-wheeling (unsynchronized) clocks so that aspect of timing is not a "problem" for us since it reflects 'real world behavior' anyway.
As mentioned, "Linux can do it", "BSD can do it", dunno if OSX can or not, and with some fancy tricks (e.g. RTX) you can do it with Windows. But there really is no good reason to have a modern OS devoid of a high-precision timer event.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara