2.3 Problems with polling

This polling technique is often used in operating systems that are designed to run one program at a time, and focuses on one device at a time. Such an operating system includes the original DOS and its predecessor, CP/M.

The disadvantages of polling becomes apparent when an OS is upgraded to multitask. For example, Microsoft Windows up to Windows 95/98 has cooperative multitasking. This means that each process has to voluntarily give up control (to the next one). The end result is the illusion of multitasking.

A “DOS box” in such an environment becomes a real challenge. This is because a DOS box is always stuck in a loop waiting for the next keyboard event. It does not voluntarily give up control! Microsoft had to play a lot of tricks to make a DOS box behave in a multitasking environment like early versions of Windows.

Even when a DOS box works in Windows, it does so hogging a lot of system resources. This is because it is still polling the keyboard for new events (key state changes) in a tight loop.