Operating System Tutorial

Operating System Tutorial Types of Operating System Evolution of Operating System Functions of Operating System Operating System Properties Operating System Services Components of Operating System Needs of the Operating System

Operating Systems

Linux Operating System Unix Operating System Ubuntu Operating System Chrome Operating Systems Fedora Operating System MAC Operating System MS Windows Operating System Solaris Operating System Cooperative Operating System CorelDRAW Operating System CentOS FreeBSD Operating Systems Batch Operating System MS-DOS Operating System Commercial Mobile Operating Systems

Differences

Difference Between Multi-programming and Multitasking Difference between C-LOOK and C-SCAN Difference between Rotational Latency and Disk Assess Time Trap vs Interrupt Difference between C-SCAN and SSTF Difference between SCAN and FCFS Difference between Seek Time and Disk Access Time Difference between SSTF and LOOK Difference between Process and Program in the Operating System Difference between Protection and Security in Operating System

How To

How to implement Monitors using Semaphores How to Install a Different Operating System on a PC

Questions

What is Kernel and Types of Kernel What is DOS Operating System What is Thread and Types of Thread What is Process Scheduler and Process Queue What is Context Switching What is CPU Scheduling What is Producer-Consumer Problem What is Semaphore in Operating System Monitors in Operating System What is Deadlock What is Paging and Segmentation What is Demand Paging What is Virtual Memory What is a Long term Scheduler What is Page Replacement in Operating System What is BSR Mode What is Convoy Effect What is Job Sequencing in Operating System Why is it critical for the Scheduler to distinguish between I/O-bound and CPU-bound programs Why is there a Need for an Operating System

Misc

Process Management Process State Scheduling Algorithm FCFS (First-come-First-Serve) Scheduling SJF (Shortest Job First) Scheduling Round-Robin CPU Scheduling Priority Based Scheduling HRRN (Highest Response Ratio Next) Scheduling Process Synchronization Lock Variable Mechanism TSL Mechanism Turn Variable Mechanism Interested Variable Mechanism Deadlock Avoidance Strategies for Handling Deadlock Deadlock Prevention Deadlock Detection and Recovery Resource Allocation Graph Banker’s Algorithm in Operating System Fixed Partitioning and Dynamic Partitioning Partitioning Algorithms Disk Scheduling Algorithms FCFS and SSTF Disk Scheduling Algorithm SCAN and C-SCAN Disk Scheduling Algorithm Look and C-Look Disk Scheduling Algorithm File in Operating System File Access Methods in Operating System File Allocation Method Directory Structure in Operating System N-Step-SCAN Disk Scheduling Feedback Queue in Operating System Contiguous Memory Allocation in Operating System Real-time Operating System Starvation in Operating System Thrashing in Operating System 5 Goals of Operating System Advantages of Operating System Advantages of UNIX Operating System Bit Vector in Operating System Booting Process in Operating System Can a Computer Run Without the Operating System Dining Philosophers Problem in Operating System Free Space Management in Operating System Inter Process Communication in Operating System Swapping in Operating System Memory Management in Operating System Multiprogramming Operating System Multitasking Operating Systems Multi-user Operating Systems Non-Contiguous Memory Allocation in Operating System Page Table in Operating System Process Scheduling in Operating System Segmentation in Operating System Simple Structure in Operating System Single-User Operating System Two Phase Locking Protocol Advantages and Disadvantages of Operating System Arithmetic operations in binary number system Assemblers in the operating system Bakery Algorithm in Operating System Benefits of Ubuntu Operating System CPU Scheduling Criteria in Operating System Critical Section in Operating System Device Management in Operating System Linux Scheduler in Operating System Long Term Scheduler in Operating System Mutex in Operating System Operating System Failure Peterson's Solution in Operating System Privileged and Non-Privileged Instructions in Operating System Swapping in Operating System Types of Operating System Zombie and Orphan Process in Operating System 62-bit operating system Advantages and Disadvantages of Batch Operating System Boot Block and Bad Block in Operating System Contiguous and Non - Contiguous Memory Allocation in Operating System Control and Distribution Systems in Operations Management Control Program in Operating System Convergent Technologies in Operating System Convoy Effect in Operating System Copy Operating Systems to SSD Core Components of Operating System Core of UNIX Operating System Correct Value to return to the Operating System Corrupted Operating System Cos is Smart Card Operating System Cosmos Operating Systems Examples Generation of Operating System Hardware Solution in Operating System Process Control Block in Operating System Function of Kernel in Operating System Operating System Layers History of Debian Operating Systems Branches and Architecture of Debian Operating Systems Features and Packages of Debian Operating Systems Installation of Operating System on a New PC Organizational Structure and Development in Debian Operating Systems User Interface in Operating System Types Of Memory in OS Operating System in Nokia Multilevel Paging in OS Memory Mapping Techniques in OS Memory Layout of a Process in Operating System Hardware Protection in Operating System Functions of File Management in Operating System Core of Linux Operating System Cache Replacement Policy in Operating System Cache Line and Cache Size in Operating System What is Memory Mapping? Difference Between Network Operating System And Distributed Operating System What is the difference between a Hard link and a Soft Link? Principles of Preemptive Scheduling Process Scheduling Algorithms What is NOS? What is the Interrupt I/O Process? What is Time Sharing OS What is process termination? What is Time-Sharing Operating System What is Batch File File system manipulation

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.