×

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

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.

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.

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.

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.

Resource Allocation Graph in Operating System

Resource Allocation Graph in OS We use the resource allocation graph for the pictographic representation of the state of a system. The resource allocation graph contains all the information related to the processes that...

5 minutes read.

Multitasking Operating Systems

An operating system is the fundamental piece of software that enables a computer system to function and execute a command as intended. The user interface, hardware, and every other piece...

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

Real-time Operating System

In this essay, we will thoroughly understand the real-time operating system. Real-Time Operating System: What do you mean? For any task to be completed, a real-time operating system (RTOS), a special-purpose operating...

5 minutes read.

Round-Robin Scheduling Algorithm in OS

Round-Robin is a Preemptive Scheduling Algorithm and is the most commonly used algorithm in CPU Scheduling.In this, each Process is assigned with a fix time interval to execute, which is...

5 minutes read.

Commercial Mobile Operating Systems

Introduction to Commercial Mobile Operating Systems A computer program's common services are managed by an operating system (OS), which also handles computer hardware and software resources. The user can communicate with...

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

Turn Variable or Strict Alternative Approach

Turn Variable or Strict Alternative Approach Turn Variable Approach is used for process synchronization mechanism, which offers synchronization between two processes. Turn variable is implemented on user mode, and it is a software mechanism. We...

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.

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.

Difference between C-SCAN and SSTF Disk Scheduling Algorithm

C-SCAN / Circular Elevator The circular SCAN (C-SCAN) scheduling method is a modified version of the SCAN disc scheduling technique that addresses the SCAN algorithm's inefficiency by more equitably serving requests....

3 minutes read.

Evolution of Operating System

Evolution of Operating System The evolution of various types of operating systems can be briefly described as follows: Serial Processing Since 1950, the operating system started to be in use. Before 1950, there...

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

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.

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.

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.