×

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

Deadlock Detection and Recovery

Deadlock Detection and Recovery In deadlock detection and recovery, to avoid or prevent a deadlock, the operating system uses various methods. For checking deadlock, an operating system continuously monitors the system. Then also,...

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

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.

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.

Memory Management in Operating System

The term "Main Memory" refers to the computer's internal physical memory. It is distinguished from external mass storage devices like disk drives by using the term "main." RAM is another...

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

Types of Operating System

There are various types of operating system: Simple Batch Operating SystemMultiprogramming batch Operating SystemTime-sharing Operating SystemMultiprocessor Operating SystemDistributed Operating SystemNetwork Operating SystemReal-time Operating SystemMobile Operating System Simple Batch operating system In the simple batch operating system, there is no direct communication between...

6 minutes read.

Fixed Partitioning in Operating System

Fixed Partitioning in OS Fixed Partitioning is also known as Contiguous memory allocation. Fixed Partitioning is the easiest method, which is used to load more than one process into the main memory. In Fixed...

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

Distributed Shared Memory

Distributed Shared Memory is a process of managing memory over more than one node and makes inter-process communication which transfers to end users. It is a mechanism that allows user...

2 minutes read.

Difference between SSTF and LOOK Disk Scheduling Algorithm

Shortest Seek Time First / SSTF Shortest Seek Time First (SSTF) is an acronym for "shortest seek time first." The task request that is closest to the present position of the...

4 minutes read.

Operating System Properties

The Properties of Operating System are: Batch processingMultitaskingMulti-programmingInteractivityReal-Time SystemDistributed Environmentspooling 1. Batch Processing In Batch Processing, the OS first gathers the data and programs together in a batch, then processing starts. The operating system...

3 minutes read.

Functions of Operating System

The functions of Operating System are: Process Management Memory Management File Management Device Management Secondary storage Management Security Coordination between other software and users Networking Job Accounting Error detecting aids 1. Process Management Process Management support operating system to create and delete...

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

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.

Producer-Consumer Problem in OS

What is Producer-Consumer Problem? The Producer-Consumer problem is a classical problem. The Producer-Consumer problem is used for multi-process synchronization, which means synchronization between more than one processes. In this problem, we have one producer...

4 minutes read.

Booting Process in Operating System

What is Booting? Booting is defined as the term which says that the process of loading the operating system into the memory. The process of booting begins when we switch on...

4 minutes read.

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.

Process Management in OS

A Program will not do anything unless a CPU executes its instructions. An executing program is called a process. The Process requires computer resources to complete its task. More than...

3 minutes read.

Dining Philosophers Problem in Operating System

Edsger Wybe Dijkstra was a well-known Dutch scientist. He was the first person ever to present the Dining Philosophers Problem in the stream of Computer Science. The dining philosophers problem...

5 minutes read.