has, and does, exhibit pretty much every kind of multitasking discipline there could be.
Windows < 95 (Win16)
Back in the old days
have full pre-emptive multi-tasking
, but it was only applied to dos
programs, which for obvious reasons had no concept of multiple process
es, let alone multitasking.
Bizzarely, the windows programs instead used co-operative multitasking, whereby each process chose the point at which to yield, and windows chose the next process to run.
Dos programs continue to be pre-empted, but pre-emption is also introduced for new Windows programs ("Win32
programs"). Under this scheme, programs do not worry about yielding, they just run as if there were no multitasking. Win16
programs continue to yield, but may also be preempted.
s, rather than processes; it gives dos and win16 programs their own single thread for each program to run inside a single process for each class, which continue to be provided with the same threading model as they are accustomed to. Meanwhile programs targetting the NT platform can make use of the fact that they may be multithreaded, and that threads can yield nominating their successor thread
. The operating system
will "normally" follow this suggestion, the justification being that threads will often know which threads - at least from their own program - are likely to be able to proceed, and which not; of course it may pre-empt threads arbitrarily, and choose their successor arbitrarily - threads cannot rely on getting their way. To see the benefits of this, imagine a producer-consumer
system with n
producers and n
consumers: if the channel is filled by a producer, running any other producer would be a waste, while the consumers would be ready to go immediately.