The Wayback Machine - https://web.archive.org/web/20240927005156/https://www.geeksforgeeks.org/n-step-scan-disk-scheduling/
Open In App

N-Step-SCAN disk scheduling

Last Updated : 29 Aug, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

The input-output requests that are coming from the disk are scheduled by the operating system and that scheduling of the disk is known as disk scheduling. Disk scheduling is important since multiple requests come from processes for disk but only one disk is assigned to process at a time. Seek time is one of the crucial parameters in the operating system. Requests are linked in queues henceforth seek time gets increased due to which the system becomes slow. The algorithm which is used for disk scheduling is known as Disk Scheduling Algorithm whose purpose is to reduce total seek time.

N-Step-SCAN also called N-Step-Look is actually a Disk Scheduling Algorithm. It helps in determining the motion of the Disk’s arm and also helps in servicing read and write requests. It divides the request queue into sub queues of length N. By doing this it ensures that the service guarantee objective is achieved. After this subsequent request is done they can not be allocated into N-size sub-queues since they are full by the elevator algorithm. Therefore starvation is completely eliminated and the service within N requests is guaranteed.

The N-Step-SCAN disk scheduling algorithm is a variation of the SCAN disk scheduling algorithm. Like SCAN, it works by scanning the disk surface in one direction and servicing requests along the way. However, instead of reversing direction at the end of the disk and servicing requests in the opposite direction, N-Step-SCAN divides the disk into N zones and scans each zone separately before moving on to the next zone.

By dividing the disk into zones and scanning each zone separately, N-Step-SCAN can improve disk scheduling performance by reducing the amount of time required to change the scanning direction. This can be particularly beneficial in systems with high disk I/O loads.

Overall, N-Step-SCAN is a useful disk scheduling algorithm that can improve performance in certain circumstances, particularly in systems with high disk I/O loads. However, it requires careful tuning to achieve optimal performance and may not be the best choice for all systems.

Algorithm for N-Step-SCAN Disk Scheduling

Step 1: A buffer is created for N requests.

Step 2: All the requests that are kept in this buffer are serviced in any specific wipe.

Step 3: During this time all the new incoming requests can not be added to this buffer, these new requests will be kept in a separate buffer.

Step 4: Now here comes the role of the I/O (Input Output) scheduler because when these top N requests are serviced, I/O (Input Output) scheduler chooses the next N requests and this process goes on and on.

Step 5: By doing this N-Step-SCAN allows better throughput and it is devoid of thrust.

Advantages of the N-Step-SCAN Disk Scheduling Algorithm

  • Reduces Head Movement: By dividing the disk into zones and scanning each zone separately, N-Step-SCAN can reduce the amount of head movement required to service requests, which can improve overall disk I/O performance.
  • Improves Throughput: By reducing head movement and improving disk I/O performance, N-Step-SCAN can improve overall system throughput, particularly in systems with high disk I/O loads.
  • Allows for Fine-Tuning: The zone size in N-Step-SCAN can be adjusted to balance the competing goals of reducing head movement and ensuring a reasonably uniform distribution of requests across zones, allowing for fine-tuning to achieve optimal performance.

Disadvantages of the N-Step-SCAN Disk Scheduling Algorithm

  • Complexity: N-Step-SCAN is more complex than some other disk scheduling algorithms, which can make it more difficult to implement and maintain.
  • Requires Careful Tuning: The zone size in N-Step-SCAN must be carefully chosen to achieve optimal performance, which can require additional effort and expertise.
  • May not be optimal for all systems: The benefits of N-Step-SCAN may not be realized in all systems, particularly those with low disk I/O loads or very large disk sizes.
  • Overall, N-Step-SCAN is a useful disk scheduling algorithm that can improve performance in certain circumstances, particularly in systems with high disk I/O loads. However, it requires careful tuning and may not be the best choice for all systems.

Important Points to Keep in Mind About the N-Step-SCAN Disk Scheduling Algorithm

  • The N-Step-SCAN algorithm is a variation of the SCAN algorithm that divides the disk into N sections and services requests in each section before moving on to the next section.
  • The value of N can be adjusted to suit different disk configurations and workload patterns.
  • N-Step-SCAN may not be optimal in situations with a large amount of data to be read or written in one direction, as it may lead to a large
  • number of requests being queued up in the opposite direction.
  • The algorithm may not be suitable for real-time systems where fast response times are critical.
  • N-Step-SCAN is relatively simple to implement and does not require a large amount of memory or processing power.

FAQs on N-Step Disk Scheduling Algorithms

1. Can N-Step Scan Scheduling be suitable for all types of systems?

Answer:

N-Step Scan Scheduling is effective for almost all types of systems with a large number of tasks or processes that can be divided into distinct steps.

2. Can N-Step handle dynamic tasks?

Answer:

Yes, N-Step Scan can easily handle dynamic tasks having varying workloads.



Similar Reads

Difference between SCAN and LOOK Disk scheduling algorithms
SCAN disk scheduling algorithm: In SCAN disk scheduling algorithm, head starts from one end of the disk and moves towards the other end, servicing requests in between one by one and reach the other end. Then the direction of the head is reversed and the process continues as head continuously scan back and forth to access the disk. So, this algorith
4 min read
Difference between FCFS and SCAN disk scheduling algorithms
FCFS disk scheduling algorithm: As the name suggests, the FCFS Scheduling Algorithm processes requests in the sequential order in which they arrive in the disk queue. Even if a higher priority request arrives in the schedule later, FCFS will process the request in the order that they have arrived and hence we can say that FCFS has a fair policy. Ex
3 min read
Difference between C-LOOK and C-SCAN Disk Scheduling Algorithm
C-LOOK Disk Scheduling Algorithm C-LOOK is the modified version of both LOOK and C-scan algorithms. In this algorithm, the head starts from the first request in one direction and moves towards the last request at another end, serving all request in between. After reaching the last request in one end, the head jumps in another direction and move tow
3 min read
Difference between FCFS and C-SCAN disk scheduling algorithm
1. FCFS Disk Scheduling Algorithm : FCFS stands for First come first serve, this algorithm entertains the task in the order they arrived in the disk queue. It is the simplest and easy to understand disk scheduling algorithm. In this the head or pointer moves in the direction in which the task arrives and moves till all request is served. However, F
3 min read
C-SCAN Disk Scheduling Algorithm
Given an array of disk track numbers and initial head position, our task is to find the total number of seek operations to access all the requested tracks if a C-SCAN Disk Scheduling algorithm is used. The Circular SCAN (C-SCAN) Scheduling Algorithm is a modified version of the SCAN Disk Scheduling Algorithm that deals with the inefficiency of the
12 min read
Difference Between C-SCAN and SSTF Disk Scheduling Algorithm
In C-SCAN Algorithm it is necessary to take into account the direction, i.e., larger or smaller value. This algorithm serves disk requests by moving towards their conclusion while SSTF is a secondary storage scheduling method that decides how the disk's head and arm will move to fulfil read and write requests. In this article, you will discover the
5 min read
SCAN (Elevator) Disk Scheduling Algorithms
In the SCAN Disk Scheduling Algorithm, the head starts from one end of the disk and moves towards the other end, servicing requests in between one by one and reaching the other end. Then the direction of the head is reversed and the process continues as the head continuously scans back and forth to access the disk. In this article, we will look int
12 min read
Difference Between SCAN and CSCAN Disk Scheduling Algorithms
The disk scheduling algorithm is a technique operating systems use to manage the order in which disk I/O (input/output) requests are processed. Disk scheduling is also known as I/O Scheduling. The main goals of disk scheduling are to optimize the performance of disk operations, reduce the time it takes to access data, and improve overall system eff
7 min read
Difference between Seek Time and Disk Access Time in Disk Scheduling
Seek Time: A disk is divided into many circular tracks. Seek Time is defined as the time required by the read/write head to move from one track to another. Example, Consider the following diagram, the read/write head is currently on track 1. Now, on the next read/write request, we may want to read data from Track 4, in this case, our read/write hea
3 min read
Difference between Transfer Time and Disk Access Time in Disk Scheduling
1. Transfer Time : Time required to transfer the required amount of data. It can be calculated by the given formula Transfer time, = Data to be transfer / transfer rate Data to be transfer is given in the question and transfer rate is sometimes given and sometimes it may not be given. It can be calculated by the given formula. Transfer Rate, = {(Nu
2 min read
Difference between Rotational Latency and Disk Access Time in Disk Scheduling
1. Rotational Latency : Rotational Latency is also known as Rotational time. The amount of time taken by the disk to rotate the track when the read/write head come to exact sector or we can also say that the time taken by the desired sector to come under the read/write head is called rotational latency. Rotational Latency is depends on the rotation
4 min read
SCAN - EDF Scheduling in OS
SCAN-EDF is a disk scheduling algorithm that is the same as the EDF algorithm but utilizes the seek optimization technique of the 'SCAN' algorithm when similar deadlines occur. It is a hybrid algorithm. To understand the importance of this algorithm, let us first look at the drawbacks of strictly following the Earliest Deadline First (EDF) algorith
4 min read
Difference between Magnetic Disk and Optical Disk
The magnetic and optical disks are the storage devices that provide a way to store data for a long duration. Both are categorized as secondary storage devices. In this article, we are going to discuss the Difference between Magnetic Disks and Optical disks in detail. What is a Magnetic Disk?A magnetic disk is a storage device that uses a magnetizat
4 min read
Difference Between Basic Disk and Dynamic Disk
When managing storage in Windows operating systems, you might come across two primary kinds of disk configurations: Basic Disk and Dynamic Disk. To do this well and make sure that your data is organized according to your needs, it becomes important to know the differentiation between these disk types. This article will explore the main features and
6 min read
FCFS Disk Scheduling Algorithms
Prerequisite: Disk scheduling algorithms.Given an array of disk track numbers and initial head position, our task is to find the total number of seek operations done to access all the requested tracks if First Come First Serve (FCFS) disk scheduling algorithm is used. First Come First Serve (FCFS) FCFS is the simplest disk scheduling algorithm. As
6 min read
LOOK Disk Scheduling Algorithm
The LOOK Disk Scheduling Algorithm is the advanced version of the SCAN (elevator) disk scheduling algorithm which gives slightly better seek time than any other algorithm in the hierarchy (FCFS->SRTF->SCAN->C-SCAN->LOOK). It is used to reduce the amount of time it takes to access data on a hard disk drive by minimizing the seek time bet
13 min read
Difference between Rotational Latency and Transfer Time in Disk Scheduling
1. Rotational Latency: Rotational Latency is the amount of time it takes for the desired sector of a to rotate under the read-write heads of the disk drive. In other words, the disk is divided into many circular tracks, and these tracks are further divided into blocks knows as sectors. So Rotational Latency is the time required by the read/write he
2 min read
Advantages and Disadvantages of various Disk scheduling algorithms
Prerequisite - Disk Scheduling Algorithms 1. First Come First Serve (FCFS) : Advantages - First Come First Serve algorithm has a very simple logic, it executes the process requests one by one in the sequence they arrive. Thus, First Come First Serve is very simple and easy to understand and implement. In FCFS eventually, each and every process gets
3 min read
Difference between FCFS and SSTF Disk Scheduling Algorithm
Prerequisite - Disk Scheduling Algorithms 1. FCFS Disk Scheduling Algorithm : First come first serve, as name suggest this algorithm entertains the task in the order they arrived in the disk queue. It is the simplest and easy to understand disk scheduling algorithm. In this the head or pointer moves in the direction in which the task arrives and mo
3 min read
Difference between SSTF and LOOK disk scheduling algorithm
1. SSTF disk scheduling algorithm : SSTF stands for Shortest Seek Time First. As the name specify, this algorithm serves the task request which is closest to current position of head or pointer. Here, the direction of head plays an vital role in determining total head movement. If there occurs a tie between requests then the head will serve the req
3 min read
Difference between LOOK and C-LOOK Disk scheduling algorithms
1. LOOK disk scheduling algorithm : Look Algorithm is actually an improves version of SCAN Algorithm. In this algorithm, the head starts from first request at one side of disk and moves towards the other end by serving all requests in between. After reaching the last request of one end, the head reverse its direction and returns to first request, s
3 min read
Difference between FCFS and C-LOOK disk scheduling algorithm
1. FCFS Disk Scheduling Algorithm FCFS stands for First Come First Serve, this algorithm entertains the task in the order they arrived in the disk queue. It is the simplest and easy to understand disk scheduling algorithm. In this, the head or pointer moves in the direction in which the task arrives and moves till all request is served. However, th
3 min read
FScan disk scheduling algorithm
Fixed period SCAN (FSCAN) disk scheduling algorithm mainly focuses on handling high variance in shortest seek time first (SSTF). SCAN algorithm is also proposed to handle above mentioned situation but using SCAN algorithm causes long delay while handling requests which are at extremes of disk. FSCAN algorithm determines how read and write head of d
3 min read
Program for SSTF Disk Scheduling Algorithm
Given an array of disk track numbers and initial head position, our task is to find the total number of seek operations done to access all the requested tracks if Shortest Seek Time First (SSTF) is a disk scheduling algorithm is used. The basic idea is the tracks that are closer to the current disk head position should be serviced first in order to
10 min read
Difference Between SSTF and C-LOOK Disk Scheduling Algorithm
The secondary storage scheduling algorithm known as SSTF decides how the disk's head and arm will move in response to read and write requests while in C-SCAN the head services request only in one direction(either left or right) until all the requests in this direction are not serviced and then jumps back to the farthest request in the other directi
7 min read
Difference Between Seek Time and Transfer Time in Disk Scheduling
The head's seek time is the time it takes to move from the current track to the one containing the data. The amount of time needed to move data from the disc to the host system is called the transfer time. In hard drives, a head is present which is supposed to write or read from the magnetic disk. In this article we are going to discuss what are se
4 min read
Disk Scheduling Algorithms
Disk scheduling is a technique operating systems use to manage the order in which disk I/O (input/output) requests are processed. Disk scheduling is also known as I/O Scheduling. The main goals of disk scheduling are to optimize the performance of disk operations, reduce the time it takes to access data and improve overall system efficiency. In thi
12 min read
Difference between Seek Time and Rotational Latency in Disk Scheduling
Disk management is essential for data storage, retrieval of data and backup the data. To store the data in the disk some I/O operations like read/write are needed. The operating system uses disk scheduling techniques which can be used to schedule I/O requests arriving to the disk. This disk scheduling techniques uses some measurements to improve th
4 min read
Difference between Priority Scheduling and Round Robin (RR) CPU scheduling
1. Priority Scheduling Algorithm : Priority scheduling algorithm executes the processes depending upon their priority. Each process is allocated a priority and the process with the highest priority is executed first. Priorities can be defined internally as well as externally. Internal priorities are decided by the system depending upon the number o
3 min read
Difference between Priority scheduling and Shortest Job First (SJF) CPU scheduling
1. Priority Scheduling Algorithm : Priority scheduling algorithm executes the processes depending upon their priority. Each process is allocated a priority and the process with the highest priority is executed first. Priorities can be defined internally as well as externally. Internal priorities are decided by the system depending upon the number o
3 min read