Wojtek Lerch wrote:
A thread that calls
InterruptMask() and InterruptUnmask() can get pre-empted between those
calls, too. The main difference is that InterruptAttachEvent() may let it
happen more often (sometimes a lot more often), because it makes it possible
for your interrupt to get masked while a high-priority thread is already
running. Whether that’s a big difference depends on whether you can live
with it happening occasionally; but if it can cause people to die when it
happens, it’s probably better if it happens every five seconds rather than
once in five months, because this way your product won’t get shipped until
it’s fixed.
I think a real-time o.s. should guarantee none of its device drivers
keep interrupt totally disabled (cli/sti) or any IRQ masked
(InterruptMask+InterruptAttachEvent/InterruptUnmask) for more than a
little amount of time.
I mean “little amount of time” as something like a few us (thousands of
clock cycles for a modern PC!).
If the customer application has special requirements, then it will
decide to use IRQ masking for its devices, choosing all related
advantages/drowbacks: using IRQ masking in o.s. distribuited network
drivers (only network ones?) does not allow customer software to expect
a deterministic interrupt handling behaviour at all, imho.
Thus, the o.s. cannot be called a “real-time” one.
Davide
–
/* Ancri Davide - */