Operating System Tutorial

What is Operating System Evolution of Operating System Types of Operating System Functions of Operating System What is Kernel and Types of Kernel Operating System Properties Operating System Services Components of Operating System Needs of the Operating System Linux Operating System Unix Operating System Ubuntu Operating System What is DOS Operating System Difference Between Multi-programming and Multitasking What is Thread and Types of Thread Process Management Process State What is Process Scheduler and Process Queue What is Context Switching What is CPU Scheduling Scheduling Algorithm FCFS (First-come-First-Serve) Scheduling SJF (Shortest Job First) Scheduling Round-Robin CPU Scheduling Priority Based Scheduling HRRN (Highest Response Ratio Next) Scheduling Process Synchronization Lock Variable Mechanism TSL Mechanism Turn Variable Mechanism Interested Variable Mechanism What is Producer-Consumer Problem What is Semaphore in Operating System Monitors in Operating System What is Deadlock Deadlock Avoidance Strategies for Handling Deadlock Deadlock Prevention Deadlock Detection and Recovery Resource Allocation Graph Banker’s Algorithm in Operating System Fixed Partitioning and Dynamic Partitioning Partitioning Algorithms What is Paging and Segmentation What is Demand Paging What is Virtual Memory Disk Scheduling Algorithms FCFS and SSTF Disk Scheduling Algorithm SCAN and C-SCAN Disk Scheduling Algorithm Look and C-Look Disk Scheduling Algorithm File in Operating System File Access Methods in Operating System File Allocation Method Directory Structure in Operating System Difference between C-LOOK and C-SCAN Difference between Rotational Latency and Disk Assess Time Trap vs Interrupt How to implement Monitors using Semaphores N-Step-SCAN Disk Scheduling Why is it critical for the Scheduler to distinguish between I/O-bound and CPU-bound programs Difference between C-SCAN and SSTF Difference between SCAN and FCFS Difference between Seek Time and Disk Access Time Difference between SSTF and LOOK

Difference between SCAN and FCFS Disk Scheduling Algorithm

SCAN / Elevator Algorithm

A different form of disc scheduling method is the SCAN disc scheduling algorithm. We move the disc arm in a certain direction in this process (the direction can be moved to the larger value or the smallest value). Each request that comes into its route is answered, and when it reaches the end of the disc, the disc arm moves backwards, and all requests that come into its path are addressed. Because it works like an elevator, the scan disc scheduling technique is sometimes known as an elevator algorithm.

Benefits:

  • The response time variance in SCAN disc scheduling is modest.
  • Throughput is high with this algorithm.
  • The response time is typical.
  • There is no hunger in SCAN disc scheduling.

Drawback:

  • The SCAN disc scheduling technique takes a long time to visit cylinders that have recently been visited by the head.
  • Even if there are no requests to serve, we must move the disc head to the end of the disc in SCAN disc scheduling.

Example:

Consider a disc with tracks 0-199 and the track numbers 93, 176, 42, 148, 27, 14, 180, and 93, 176, 42, 148, 27, 14, 180, respectively, in the request queue. The read/write head is currently at position 55, and it is pointing in the direction of the bigger value. Count the total number of cylinders moved by the head, using scan disc scheduling. The disc has 200 tracks, as seen in the following example. As a result, we'll use a track line ranging from 0 to 199.

The read/write head is now at position 55. As a result, we begin at 55 and then shift the read/write head. When all requests are met, the total number of cylinders moved by the head is calculated.

Difference Between SCAN And FCFS Disk Scheduling Algorithm

= (199-50) + (199-14)

= 329

FCFS Disk Scheduling Algorithm

FCFS is an operating system scheduling method that automatically executes queued requests and processes in the order of their arrival. This is the simplest and most straight forward CPU scheduling algorithm. Processes requesting CPU first get the first CPU allocation in this type of method. A FIFO queue is used to manage this. FCFS stands for first come, first served. The FCFS (First-Come-First-Serve) disc scheduling method is the simplest of all the scheduling algorithms. Each input/output request is presented in the order that they arrive in the FCFS disk scheduling mechanism. Because FCFS addresses each request, there is no hunger in this process. Example: Purchasing a movie ticket at the box office is an example of the FCFS system in action. A person is serviced according to the queue method in this scheduling system.The person who is in the first row buys the ticket first, followed by the next ticket. This will continue until the ticket is purchased by the last person in line. The CPU process operates in a similar way when using this technique.

Benefits:

  • There is no unlimited delay in FCFS disc scheduling.
  • FCFS disc scheduling avoids hunger by giving each request an equal opportunity.

Drawback:

  • FCFS scheduling is not the finest service available.
  • Scheduling disc time is not optimal in FCFS.

Example:

Considering the same problem statement shown in the example of SCAN Disk Scheduling Algorithm above. The read/write head is now at position 55. As a result, we'll start at 55 and work our way through the FCFS sequence of read/write heads. When all requests are met, the total number of cylinders moved by the head is calculated.

Difference Between SCAN And FCFS Disk Scheduling Algorithm

= (176-55) + (176-42) + (148-42) + (148-14) + (180-14)

= 121+134+106+134+166

=661   

Difference between SCAN and FCFS Scheduling algoritm.

S no.SCANFCFS
1.The scan scheduling algorithm processes requests in one way until it reaches the end of the disk, at which point the disk arm changes direction and begins serving requests in the opposite order.The FCFS Scheduling Algorithm will process requests in the order they are received in the disc queue.
2.It's possible that the request's location was recently visited by the disc arm, causing the request to take a lengthy time to complete.There are less risks of extended postponement using the FCFS algorithm since requests are handled according to schedule.
3.The SCAN algorithm outperforms the FCFS scheduling method in terms of throughput.Of all the disk scheduling techniques, the FCFS algorithm has the lowest throughput.
4.When compared to the FCFS scheduling method, the SCAN algorithm has a substantially shorter average search time.Because it does not aim to minimise the seek time, the FCFS method has the longest average seek time of all the disc scheduling algorithms.



ADVERTISEMENT
ADVERTISEMENT