
CPU Clocks and Clock Interrupts, and Their Effects on Schedulers - r4um
http://accu.org/index.php/journals/2185
======
jdub
One interesting thing this (dated but still very relevant) article misses is
timer coalescing.

Most modern operating systems try to merge a bunch of timer actions into a
single wake/interrupt. Not only does this leave more time for other work to be
done in the normal case of a loaded CPU, but if there's less demand, it
provides way more opportunity for the CPU to fall into a lower power state.

Some timer APIs will let you specify how accurate you want your timer to be.
Often enough, a few tens or hundreds of milliseconds doesn't really matter for
your use case, but that's AEONS in CPU time!

------
ravanave
"A SPNT OS has no real need of a scheduler."

I would rather disagree:
[https://en.wikipedia.org/wiki/Computer_multitasking](https://en.wikipedia.org/wiki/Computer_multitasking).
OS in the most of the cases needs to be interactive, what would be impossible
without multitasking. Multitasking would not be possible without a scheduler.
So, we would not swap the active task and we would be stuck with the current
task forever (or until it finishes), without even the ability to interrupt it.

~~~
stefantalpalaru
> A single process, non-threaded (SPNT) OS runs one process at a time

There's no multitasking in this scenario. Think MS-DOS 6.22.

~~~
ravanave
Of course, there does not have to be, but if there would then it would be very
useful. Think MS-DOS 4.0 multitasking: [https://en.wikipedia.org/wiki/MS-
DOS_4.0_(multitasking)](https://en.wikipedia.org/wiki/MS-
DOS_4.0_\(multitasking\))

One process can have a preemptive multitasking. Even one process can make a
very good use of a scheduler.

