deathshadow60 wrote:Certain PIO disk devices, software controlled refreshes and polling on non-DMA computers (Jr/1k) -- they can often crash if you don't call it soon enough/often enough or spread out enough.
Good point, and something to watch out for.
you spread it out instead of blowing it all out in one slice... Which is usually why timers are used in the first place.
See why multitasking time slicing is pretty much how every modern OS handles it.
Were I writing an OS that has to manage multiple timeslices of unknown duration, I would agree, but DOS programs have access to the entire machine when they're running and the author of a program knows beforehand how long each timeslice takes. On fast machines, the overhead is negligible, but for machines as slow as the ones we work with, interrupt service overhead is substantial.
For a program that, for example,
must update the screen at an interval of 30Hz, there is no difference between a 30Hz timer that "blows it all out in once slice", and one that uses a 240Hz timer and spaces calcs out, updating the screen once every 8 ticks. In fact, I'd argue that the latter method is less efficient, because calcs in one timeslice that finish early waste time that cannot be used by calcs in other timeslices (or worse, one timeslice will get interrupted by another).