I was not refering to the CPU context save/restore that happens in any ISR, I was refering to the task context, that the scheduller saves/restores when switching tasks.
I know. That is why I said it was grey. Checking more (leaving the ISR at a fixed interval) has some overhead, but improves realtime characteristics (a different interrupt is reacted to in less time, max the time between intervals, on average half)
BUT in systems like x86 where interrupts are expensive, this can eat into throughput, so usually depending on priority and past history of using a full slice, the slice is sometimes elongated. On the otherhand, x86 typically has very high freq and very high throughput/freq, so the slices are already quite small (1us magnitude)
In real OSes, you can also check if an important interrupt occurred on every system entry (syscall), and invoke the scheduler if needed.
"can" or "must"?
Without that the task management decays to a basic time-sharing system and will lose most of its "real time"
If it is a non-blocking call (e.g. fetching some data from the thread context), it is not a must.
Also doing the checks also costs time, and while average response improves, there is no guarantee that the task actually calls a syscall (it might be calculating pi or the golden ratio to many digits, and then render a fractal based on that calculation), and having fixed limits is a bit a case for (hard) real time.
So no, I don't think that is a requirement for realtime.
If you are interested in this stuff, I can recommend the "design and implementation of 4.4BSD" book.
I've been playing with this stuff since back in 1982 (i8085, Z80, i8086,......,Linux, PICs), but can allways learn some new tricks. Thank you for helping in the selection, when you don't have much free time, its hard to review all the stuff out there to select what is worth the time and money.
Andrew S. Tanenbaum - Modern Operating systems is another such classic. For IPC and TCPIP you want Richard Stevens' books. I picked up slightly older editions at bargain prices.
It is wise to have a bunch of desirable titles on list, and regularly check marketplace sites for cheap used copies.