0% found this document useful (0 votes)
236 views3 pages

Advantages and Disadvanteags of Cpu Scheduling Algortithms

Uploaded by

shubhamjha160704
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
236 views3 pages

Advantages and Disadvanteags of Cpu Scheduling Algortithms

Uploaded by

shubhamjha160704
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

CPU scheduling algorithms are used in operating systems to determine the order in which processes

or threads are executed on the CPU. Each scheduling algorithm has its own advantages and
disadvantages, which can impact system performance and user experience. Here are some common
CPU scheduling algorithms and their pros and cons:

1. First-Come, First-Served (FCFS):

 Advantages:

 Simple and easy to understand.

 Fair for all processes as they are executed in the order they arrive.

 Disadvantages:

 Poor utilization of CPU time, especially when long processes are ahead in the
queue (the "convoy effect").

 Doesn't consider process priority or execution time.

2. Shortest Job First (SJF):

 Advantages:

 Minimizes average waiting time and turnaround time.

 Efficient for batch processing when process execution times are known in
advance.

 Disadvantages:

 Requires knowledge of process execution times, which is often not available


in real-time systems.

 May lead to starvation for long processes if short processes continuously


arrive.

3. Priority Scheduling:

 Advantages:

 Allows for priority-based execution, ensuring high-priority processes get


executed first.

 Flexible and suitable for systems with varying task priorities.

 Disadvantages:

 May result in low-priority processes experiencing starvation.

 If not properly managed, high-priority processes can monopolize the CPU.

4. Round Robin (RR):

 Advantages:

 Fairly allocates CPU time to all processes.


 Suitable for time-sharing systems, ensuring that no process waits
indefinitely.

 Disadvantages:

 Inefficient for long processes as they may need to wait a long time for their
turn.

 High context-switching overhead, which can reduce overall system


performance.

5. Multilevel Queue Scheduling:

 Advantages:

 Efficiently handles processes with different priorities and characteristics by


categorizing them into multiple queues.

 Each queue can have its scheduling algorithm tailored to its specific
requirements.

 Disadvantages:

 Complexity increases with the number of queues and scheduling policies.

 Requires careful tuning of priorities and queue management.

6. Multilevel Feedback Queue Scheduling:

 Advantages:

 Adaptable and dynamic, allowing processes to move between queues based


on their behavior.

 Can handle a mix of short and long processes effectively.

 Disadvantages:

 Complexity due to the management of multiple queues and priority levels.

 Requires parameter tuning for optimal performance.

7. Highest Response Ratio Next (HRRN):

 Advantages:

 Dynamically prioritizes processes based on response ratios, optimizing both


turnaround time and fairness.

 Disadvantages:

 Complexity in calculating response ratios for each process.

 May not perform well in practice due to high computation overhead.

Advantages of SRTF:

1. Minimizes the average waiting time, making it efficient in terms of turnaround time.
2. Ensures that shorter processes are executed with minimal delay, leading to better system
responsiveness.

Disadvantages of SRTF:

1. High context-switching overhead: Frequent preemptions can lead to increased overhead due
to context switching.

2. Complexity: Accurately estimating the remaining execution time of processes can be


challenging.

3. Potential for starvation: Long processes may suffer from starvation if shorter processes
continuously arrive.

4. May not be suitable for real-time systems: SRTF requires precise knowledge of process
execution times, which is often not available in real-time environments.

You might also like