Which task do I do now?
A multitasking operating system is one in which several tasks can be in progress at the same time. Most modern operating systems are multitasking, the major exception being systems dedicated to a single application.
Most multitasking operating systems are event driven, and many of them are preemptive, that is, they interrupt the running task when a higher-priority task becomes ready or the task has been running longer than a specified time. A multitasking system uses a dispatcher [see the post on event-driven systems] to determine which task to run next. A multitasking system provides locks to prevent concurrent access to shared resources, and must detect deadlock conditions where two or more tasks issue exclusive requests for the same resources while holding resources required by the other tasks.
Read more »