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.
Tasks in a multitasking system must make sure that any changes in a shared resource are done so that data integrity is maintained at all times. Tasks must also allocate and free resources in such a way if any task can allocate a resource used by this task, this task cannot block that task by allocating a resource which that task will use. If a task must wait for a resource or event, it should relinquish control to the dispatcher.
If the operating system can determine what resources might be used by each task, the system can avoid deadlocks by allocating a resource to a task only if no other tasks that might use it hold a resource that the task receiving the current resource might request.
0 Comments:
Post a Comment
Please enter your comment here. Comments wil be reviewed before being published.
Subscribe to Post Comments [Atom]
<< Home