Difference between preemptive and non preemptive algorithm in CPU Scheduling in Operating System

0

 


Here is a comparison of Preemptive and Non-Preemptive Algorithms in CPU Scheduling in Operating System:

FeaturePreemptive SchedulingNon-Preemptive Scheduling
DefinitionA scheduling algorithm in which the operating system can interrupt a running process and allocate the CPU to another process with higher priority.A scheduling algorithm in which once a process has been allocated the CPU, it continues to run until it terminates or blocks on I/O.
PriorityProcesses with higher priority are given priority over processes with lower priority.Processes are given the CPU for a defined time slice or until they complete execution.
InterruptionsProcesses can be interrupted at any time by the operating system.Processes cannot be interrupted until they complete execution or block on I/O.
Context SwitchingContext switching occurs more frequently in preemptive scheduling, leading to higher overhead.Context switching occurs less frequently in non-preemptive scheduling, leading to lower overhead.
Response TimePreemptive scheduling provides a better response time for high priority tasks, as they get to run more frequently.Non-preemptive scheduling can result in poor response time for high priority tasks, as they have to wait for lower priority tasks to complete.
LatencyPreemptive scheduling can result in lower latency for high priority tasks, as they get to run more frequently.Non-preemptive scheduling can result in higher latency for high priority tasks, as they have to wait for lower priority tasks to complete.
CPU UtilizationPreemptive scheduling can result in better CPU utilization, as the CPU is shared among multiple processes.Non-preemptive scheduling can result in lower CPU utilization, as the CPU is not shared among processes.
Real-Time SystemsPreemptive scheduling is used in real-time systems to meet critical deadlines.Non-preemptive scheduling is not used in real-time systems, as it cannot guarantee predictable execution times.
User PerceptionPreemptive scheduling provides a better user experience, as high priority tasks get executed quickly.Non-preemptive scheduling can result in a poor user experience, as high priority tasks can take longer to complete.
ThroughputPreemptive scheduling can result in higher throughput, as the CPU is shared among multiple processes.Non-preemptive scheduling can result in lower throughput, as the CPU is not shared among processes.
System PerformancePreemptive scheduling can result in better system performance, as the CPU is used efficiently and effectively.Non-preemptive scheduling can result in lower system performance, as the CPU is not used as efficiently.
CPU Scheduling OverheadPreemptive scheduling has higher overhead due to the frequent context switching.Non-preemptive scheduling has lower overhead, as there is less frequent context switching.
StarvationPreemptive scheduling can result in starvation of low priority tasks, as they may never get a chance to run.Non-preemptive scheduling can prevent starvation, as all tasks get a chance to run eventually.
PredictabilityPreemptive scheduling provides less predictability, as the execution order of tasks can change dynamically.Non-preemptive scheduling provides more predictability, as the execution order of tasks is defined and does not change dynamically.

Post a Comment

0Comments
Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !