Computer Science, asked by prasantakumar4543, 1 year ago

Primitive and non primitive in os

Answers

Answered by smita24
2

Non-Preemptive Scheduling is when a task runs until it stops (voluntarily), or finishes. Windows® had Non-Preemptive Scheduling till Windows 3.x, after which it changed to Preemptive from Windows 95.Preemptive Scheduling is where a task can be forcibly suspended by a CPU interrupt, unlike Non-Preemptive where the task runs until it releases control of the CPU.

Non-Preemptive Scheduling

Tasks within a Non-Preemptive system will run until completed.

The Scheduler then checks all tasks’ states and schedules the next highest priority task with a Ready state.

With Non-Preemptive Scheduling, once a task has its assignment to the CPU, it cannot be taken away, even if short tasks have to wait for longer tasks to complete.

The scheduling management across all tasks is “fair” and response times are predictable as high priority tasks cannot bump waiting tasks further down the queue.

The Scheduler ensures each task gets its’ share of the CPU, avoiding any delay with any task.  The ‘amount of time’ allocated to the CPU may not necessarily be equal, as it depends on how long the task takes to complete.

Preemptive Scheduling

This scheduling model allows tasks to be interrupted – in contrast to Non-Preemptive Scheduling that has a “run-to-completion” approach.

The interrupts, which could be initiated from external calls, invokes the Scheduler to pause a running task to manage another higher priority task – so the control of the CPU can be preempted.

The highest priority task in a Ready state is executed, allowing rapid response to real-time events.

Some of the cons with Preemptive Scheduling involve the increase of overheads on resources when using interrupts and issues can occur with two tasks sharing data, as one may be interrupted while updating shared data structures, and could negatively affect data integrity.

On the other hand, it is practical to be able to pause a task to manage another one that could be critical.

Similar questions