×

FCFS (First-Come-First-Serve) Disk Scheduling Algorithm

FCFS Disk Scheduling Algorithm

FCFS (First-Come-First-Serve) is the easiest disk scheduling algorithm among all the scheduling algorithms. In the FCFS disk scheduling algorithm, each input/output request is served in the order in which the requests arrive. In this algorithm, starvation does not occur because FCFS address each request.

Advantages of FCFS Disk scheduling Algorithm

The advantages of FCFS disk scheduling algorithm are:

  1. In FCFS disk scheduling, there is no indefinite delay.
  2. There is no starvation in FCFS disk scheduling because each request gets a fair chance.

Disadvantages of FCFS Disk Scheduling Algorithm

The disadvantages of FCFS disk scheduling algorithm are:

  1. FCFS scheduling is not offered as the best service.
  2. In FCFS, scheduling disk time is not optimized.

Example of FCFS Disk Scheduling Algorithm

Suppose a disk contains 200 tracks (0-199) and the request queue contains track no: 93, 176, 42, 148, 27, 14,180. The current position of the read/write head is 55. Now we have to calculate the total number of track movements of read/write head using FCFS scheduling.

Solution

As mentioned in the following example, the disk contains 200 tracks, so we take a track line between 0 to 199.

The current position of the read/write head is 55. So, we start from 55, then move read/write head in the FCFS order. When all the requests are addressed, then we calculate a total number of cylinders moved by the head.

FCFS Disk Scheduling Algorithm
Figure: FCFS Disk Scheduling

Total Number of cylinders moved by the head = (176-55) + (176-42) + (148-42) + (148-14) + (180-14)

                                                                     = 121+134+106+134+166

                                                                     =661   

SSTF (Shortest Seek Time First) Disk Scheduling Algorithm

SSTF is another type of scheduling algorithm. In this type of disk scheduling, the job which has less seek time will be executed first. So, in SSTF (shortest seek time first) scheduling, we have to calculate the seek time first. and after calculating the seek time, each request will be served on the basis of seek time. The request which is close to the disk arm will be first executed. There are some drawbacks in FCFS. To overcome the limitations that arise in the FCFS. SSTF scheduling is implemented.

Advantages of SSTF Disk Scheduling

The advantages of SSTF disk scheduling are:

  1. In SSTF disk scheduling, the average response time is decreased.
  2. Increased throughput.

Disadvantages of SSTF Disk Scheduling

The disadvantages of SSTF disk scheduling are:

  1. In SSTF, there may be a chance of starvation.
  2. SSTF is not an optimal algorithm.
  3. There are chances of overhead in SSTF disk scheduling because, in this algorithm, we have to calculate the seek time in advanced.
  4. The speed of this algorithm can be decreased because direction could be switched frequently.

Example of SSTF Disk Scheduling

Consider a disk that contains 200 tracks (0-199). The request queue includes track number 82, 170, 43, 140, 24, 16, 190, respectively. The current position of the read/write head is 50.

Solution

Before solving the above example, we have to know about the seek time.

Seek Time: -Seek time is the time required to move the desired track.

To find the seek time, we can use this simple formula.

                                            seek time = Destination – Source

                                             or

                                             = Source - Destination

 Now, we can solve the given example.

As mentioned in the following example, disk contains 200 tracks. So, we will take a track line between 0 to 199. The current position of the read/write head is 50. So, we start at 50.

SSTF Disk Scheduling Algorithm
Figure: SSTF Disk Scheduling

We can see in the following figure that the current or initial position of read/write head is 50. Now for further movement of read/write head, we calculate the seek time. 

Total Number of cylinders moved by the head = (50-16) + (190-16)

                                                                     = 208


Related Topics

Swapping in Operating System

Swapping in operating systems refers to temporarily transferring a program or process from main memory to a secondary storage device, such as a hard drive or solid-state drive when there...

4 minutes read.

Disk Scheduling Algorithms

Disk Scheduling Algorithms Disk scheduling algorithms are the algorithms that are used for scheduling a disk. Generally, the scheduling refers to a time-table for completing any task or a job. With the help...

2 minutes read.

Partitioning Algorithms

Partitioning Algorithms There are various types of Partitioning Algorithm: First-Fit AlgorithmNext-Fit AlgorithmBest-Fit AlgorithmWorst-Fit AlgorithmQuick-Fit Algorithm 1. First-Fit Algorithm: - In the First-Fit Partitioning algorithm, first, the linked list is scan, and when it...

3 minutes read.

Difference between Process and Program in the Operating System

What is a process in the Operating System? A process is a program that is going through the execution. It also helps us to execute all the lines of code in...

4 minutes read.

What is Deadlock in OS?

Deadlock in Operating System In an Operating System, a process uses various resources, and the resources are used in the following manner: Request the ResourceUse the ResourceRelease the Resource In the Operating System, Deadlock is a condition...

4 minutes read.

Directory Structure in Operating System

Directory Structure in Operating System What is a Directory A Directory is the collection of the correlated files on the disk. In simple words, a directory is like a container which contains...

8 minutes read.

Scheduling Algorithms in OS

There are various types of scheduling algorithm which are used by the operating system to schedule the process on the processor. Objective of Scheduling Algorithms There are the following objectives of Scheduling Algorithms: Fare allocation...

2 minutes read.

Unix Operating System

Unix Operating System Unix Operating System is a multiuser, portable, time-sharing, and multitasking operating system that was developed in 1969. Unix operating system was developed by a group of AT &...

3 minutes read.

Difference between Protection and Security in Operating System

Some operating system mechanisms facilitate us to stop tampering with logical and physical resources. Some of these methods are security and protection. Protection and security are distinct concepts, despite the...

3 minutes read.

Trap vs Interrupt in Operating System

What is Trap in Operating System? A trap is a synchronous interrupt used to perform functionality when an error occurs in a user process. A trap in an operating system can...

4 minutes read.

N-Step-SCAN Disk Scheduling

Before you study about N-Step-SCAN Disk Scheduling, it requires prerequisite of what is Disk Scheduling Algorithms: Operating systems use disc scheduling to schedule I/O requests that arrive at the disc....

4 minutes read.

Difference between Seek Time and Disk Access Time in Disk Scheduling

Seek Time The time taken for the hard disk controller to detect a specific piece of recorded data is known as the seek time. The amount of time it takes to...

4 minutes read.

File Access Methods in Operating System

File Access Methods in OS There are various types of file access methods in the operating system: Sequential Access MethodDirect Access MethodIndex Sequential Access Method Sequential Access Method: - Sequential Access Method is...

3 minutes read.

Process Synchronization | Operating System

Process Synchronization Process Synchronization means managing the process in such a manner so that no two processes have access to share similar data and resources. We can use Process Synchronization in a Multi-Process System...

4 minutes read.

CPU Scheduling in OS

What is Scheduling? Scheduling is the process that is used to share the computing resources such as memory, processor time, and bandwidth to the different processes, data flows, threads, and applications that need...

5 minutes read.

Ubuntu Operating System

Ubuntu Operating System Ubuntu is an open-source and a Linux based operating system. Ubuntu is developed for the Network Servers, Computers, and Smartphones. The Ubuntu operating system was developed by Canonical...

3 minutes read.

Why is it critical for the Scheduler to distinguish between I/O-bound and CPU-bound programs

A CPU-bound process is one that spends most of its time executing instructions on the processor. A process that is I/O-bound spends most of its time waiting for input and...

2 minutes read.

Android Operating System

What is Android Operating System? Android is a Linux-based and open-source operating system mainly established for mobile devices like tablet computers and Smartphones. The Android operating system was established by the...

5 minutes read.

Segmentation in Operating System

The term segmentation in operating system refers to the division of computer memory into segments. Segmentation is a technique used by many modern operating systems to provide better memory management....

4 minutes read.

HRRN Scheduling in OS

Highest Response Ratio Next (HRRN) Scheduling in OS Highest Response Ratio Next Scheduling is a Non-Preemptive Scheduling algorithm. This algorithm provides the benefits of the shortest job first scheduling algorithm and also removes...

6 minutes read.