×

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. I/O scheduling is another name for disc scheduling.

  • Multiple I/O requests may arrive from distinct processes, but the disc controller can only handle one I/O request at a time. As a result, further I/O requests must wait in the queue and be scheduled.
  • Two or more requests may be separated by a significant distance, resulting in increased disc arm movement.
  • Hard drives are one of the slowest components in a computer system, thus they must be accessed quickly.

There are many disk scheduling algorithms, but before we get into them, let's look at a few key terms:

  • Seek Time: The time taken by the disk arm to identify a specific track where data is to be read or written is known as seek time. As a result, the disc scheduling technique with the shortest average seek time is preferable.
  • Rotational latency is the time it takes to rotate the required area of ??the disk into position so that the read/write heads can be reached. As a result, the disc scheduling approach with the shortest rotational delay is preferable.
  • The time it takes to send data is known as the transfer time. It is determined by the disk's rotational speed and the quantity of bytes to be transmitted.
  • Disk Response Time: Response Time is the average amount of time a request spends waiting for an I/O operation to complete. The average response time is the sum of all requests' responses. Variance Response Time is a metric that measures how quickly individual requests are handled in comparison to the average response time. As a result, the disc scheduling algorithm with the shortest variance response time is preferable.

Disk Scheduling Algorithms:

  • FCFS also known as First Come First Serve algorithm is the most basic of the Disk Scheduling Algorithms. Requests are handled in FCFS in the order they come in the disc queue.
  • SSTF (Shortest Search Time First): In SSTF (Shortest Seek Time First), the requests with the shortest seek time are processed first. As a result, each request's seek time is computed before hand in the queue, and then they are scheduled on the basis of determined seek time. As a result, the closest request to the disc arm will be processed first. SSTF is a significant improvement over FCFS, since it reduces average response time and enhances system throughput.
  • Scan: In the scan algorithm, the disk arm moves in a certain direction and serves the requests in its path, then reverses the direction and serves the incoming requests again after reaching the end of the disk. Consequently, this algorithm is also known as an elevator algorithm because it acts like an elevator. As a result, requests at the midpoint get more attention, while those after the disk arm must wait.
  • CSCAN: In the SCAN algorithm, the disc arm scans the previously scanned route again after reversing its orientation. As a result, it's conceivable that there are too many requests outstanding on the other end, or that there are none or only a few requests awaiting in the scanned region.

N-Step-SCAN

The operating system schedules the disk's input and output requests, and this disc scheduling is known as disc scheduling. Because several requests for disc occur from processes, yet only one disc is allotted to each process at a time, disc scheduling is critical. One of the most important parameters in an operating system is seek time. As a result of the requests being connected in queues, the seek time increases, causing the system to slow down. The Disk Scheduling Algorithm is a disc scheduling algorithm whose goal is to decrease overall seek time.

N-Step-SCAN is a Disk Scheduling Algorithm that is also known as N-Step-Look. It aids in the determination of Disk's arm motion as well as the processing of read and write requests. It divides the request queue into N-length sub queues. It guarantees that the service guarantee aim is met in this way. Following this, following requests cannot be assigned into N size sub queues since the elevator algorithm has filled them. As a result, hunger is totally avoided, and service within N requests is assured.

Algorithm

  1. For N requests, a buffer is established.
  2. In any given wipe, all of the requests that are retained in this buffer are handled.
  3. During this period, any new incoming requests will be maintained in a separate buffer and will not be added to this buffer.
  4. Now comes the function of the I/O (Input Output) scheduler, since after these top N requests have been fulfilled, the I/O (Input Output) scheduler selects the next N requests, and so on.

By doing so, N-Step-SCAN improves throughput and eliminates thrust.

Example of N-Step Disk Scheduling:

Allow the following tracks from a moving head disc with 200 tracks, numbered 0 to 199, to be requested in the following order: 122, 90, 160, 24, 102, 89, 143, 18, 67. The requested tracks are split into the subqueues below for N = 2.

  • subqueue 1 = {122, 90}
  • subqueue 2 = {160, 24}
  • subqueue 3 = {102, 89}
  • subqueue 4 = {143, 18}
  • subqueue 5 = {67}

For disc scheduling, sub-queue 1 with request tracks 122 and 90 is picked first. Track 90 is processed first since it is close to zero. Track 122 is processed after track 90 has been processed.

At this time, the disc head is on track 122. A track from sub-queue 2 that is closer to 122 is chosen for processing. As a result, track 160 gets chosen. Because there are no more tracks between 160 and 199 to analyse, the head travels to the last track, 199, and reverses its course to continue processing the request for track 24.

After then, the request tracks 102 and 89 in sub-queue 3 will be handled. 89 gets processed first, followed by 102, since it is closer to 24. The requests in sub-queues 4 and 5 are handled in the same way. The N-step-SCAN disc scheduling technique provides a high throughput and a short mean response time.


Related Topics

MS-DOS Operating System

It is also referred to occasionally as "DOS", an abbreviation for disc operating systems. Operating systems with a graphical user interface (GUI) in different iterations of the graphical Microsoft Windows...

5 minutes read.

Multi-user Operating Systems

Introduction Since only one user may interact with the computer at any given time, the operating system we use on our personal computers, laptops, tablets, and phones is sometimes referred to...

8 minutes read.

What is Scheduling on OS

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

5 minutes read.

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...

4 minutes read.

Lock Variable Mechanism | Operating System

Lock Variable Mechanism The Lock variable mechanism is a synchronization mechanism that is implemented in a user mode. It is a software procedure. Lock variable is a solution for busy waiting that can be...

3 minutes read.

Process Scheduling in Operating System

Process Scheduling is an essential component of a Multiprogramming Operating System. So now let’s understand how it works by taking a real-life example. Suppose that you want to call someone...

6 minutes read.

Difference between C-LOOK and C-SCAN Disk Scheduling Algorithm

Disk scheduling is used by operating systems to arrange the arrival of I/O requests to the disc. I/O scheduling is another name for disc scheduling. Disk scheduling is necessary because...

4 minutes read.

Contiguous Memory Allocation in Operating System

Memory is a place where data, facts, figures, and information are stored for temporary or permanent access the data in future, which is also considered as the storage place. Allocation of...

4 minutes read.

Deadlock Avoidance

Deadlock Avoidance In an operating system, for deadlock avoidance, we perform the following: We only grant the request of the resources if the resulting state of the system will not cause any deadlock in the...

3 minutes read.

Banker’s Algorithm in Operating System

What is Banker’s Algorithm? Bankers algorithm is an algorithm which is used for deadlock avoidance and resource allocation. It was established by Edsger Dijkstra. The reason behind the name ‘banker’s algorithm’...

8 minutes read.

Batch Operating System

Computers were once quite huge devices that operated from a console. Tape drives, punch cards, line printers were often utilized for the output, and tape drivers or card readers for...

4 minutes read.

Feedback Queue in Operating System

In a computer or a laptop, there is a processor which do all the tasks. The processor cannot do all the tasks at a time. So, the tasks will be...

3 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.

5 Goals of Operating System

An Operating System (OS) is system software that acts as an interface or bridge between the hardware of a computer and the end user. Operating System reduces the communication barrier between the...

4 minutes read.

Free Space Management in Operating System

What is Free Space Management? The system always keeps the records of the free disks blocks for allocating space to files when they are created. To use the space free from...

4 minutes read.

Test Set Lock Mechanism | Operating System

Modification in the Assembly Code The problem in the lock variable is that, in some cases, the process reads the previous or old value of the lock variable and enters into the critical...

4 minutes read.

Difference between Rotational Latency and Disk Assess Time in Disk Scheduling

Disk scheduling is used by operating systems to arrange the arrival of I/O requests to the disc. Disk scheduling is necessary because several I/O requests may occur from various processes,...

4 minutes read.

Deadlock Prevention in Operating System

Deadlock Prevention The conditions which we used for deadlock prevention are: Mutual ExclusionHold and WaitNo PreemptionCircular Wait 1. Mutual Exclusion: - From the resource point of view, the mutual exclusion means that simultaneously more...

4 minutes read.

Kernel in OS

What is Kernel in OS? The kernel is the core component in the operating system. The job of the kernel is to handle the communication between the hardware and the software. ...

2 minutes read.

What is Demand Paging?

Demand Paging is defined as a process in which the pages are loaded into the memory (when the page fault occurs) or on-demand. It consists of the following steps: If there is...

4 minutes read.