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 What is Message-passing Technique in OS Logical Clock in Distributed System

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. C-SCAN, like the SCAN (lift algorithm), moves the head from one end to the other, fulfilling all requests. However, once the head reaches the other end, it returns to the start of the disk without any requests along the way (see chart below) and starts serving again after reaching the start. The "Circular Elevator Algorithm" is named by the fact that it interprets the cylinders as a circular list that loops around from the last to the first.

Benefits:

  • This ensures a consistent wait time.
  • This allows for faster response times.
  • The head moves from one end of the disk to the other, fulfilling all requests along the way.
  • The C-SCAN scheduling method is an upgraded variant of the SCAN algorithm.

Drawback:

  • It might not be fair to service requests for tunes on the furthest reaches of the spectrum.
  • When compared to the SCAN Algorithm, it has more seek motions.

Example:

Consider a disc with 180 tracks (0-179) and a disc queue with input/output requests in the following order: 75, 90, 40, 135, 50, 170, 65, 10, 75, 90, 40, 135, 50, 170, 65, 10, 75, 90, 40, 135, 50, 170, 65, 10, 75, 90, 40, 135, 50, 170, 65, 10, 75, 90, 40 The Read/Write head's starting position is 45 degrees, and it will travel to the right. Using the C-SCAN method, determine the total number of track movements of the Read/Write head.

Answer:

Difference Between C-SCAN And SSTF Disk Scheduling Algorithm

Head motions in total,

The starting position for the head is 45 degrees.

= (50-45) + (65-50) + (75-65) + (90-75) + (135-90) + (170-135) + (179-170) + (179-0) + (10-0) + (179-170) + (179-0) + (10-0) + (40-10)

= 15 + 45 + 35 + 9 +179 + 10 + 30 = 5 + 15 + 10 +15 + 45 + 35 + 9 +179 + 10 + 30

= 353

SSTF Disk Scheduling Algorithm

Shortest Seek Time First (SSTF) is an acronym for "shortest seek time first." This approach fulfils the task request that is closest to the present location of the head or pointer, as the name implies. In this case, the direction of the head is crucial in calculating total head movement. If there is a tie between requests, the head will serve the request that comes first in the order in which it was received. In comparison to C-LOOK, the SSTF algorithm is extremely efficient in terms of overall search time. SSTF scheduling priority is given to processes that have the fewest searches. To do this, the time of each request is calculated in advance in the queue, and then requests are scheduled based on their search time.

Benefits:

  • It enhances and expands throughput.
  • The overall seek time of the SSTF is less than that of the FCFS.
  • It offers a faster response time and a shorter average wait time.

Drawback:

  • Requests made far from the head might result in starvation.
  • The significant variation in response time and waiting time is accessible in the SSTF disc scheduling technique.
  • Frequent changes in the direction of the head slow down the algorithm.

Example:

To further understand the SSTF Disk Scheduling Algorithm, let's look at an example. Consider a disc with 180 tracks (0-179) and a disc queue with the following input/output requests: 92, 100, 40, 148, 67, 170, 29, ten, ten, ten, ten, ten, ten, ten, ten, ten The Read/Write head's starting position is 45 degrees, and it will shift to the left side. Using the SSTF technique, calculate the total number of track movements for the read/write head.

Answer:

Difference Between C-SCAN And SSTF Disk Scheduling Algorithm

Head motions in total,

The initial head point is 45 degrees.

= (45-40) + (40-29) + (29-10) + (67-10) + (92-67) + (100-92) + (148-100) + (100-92) + (148-100) + (170-148)

= 5 + 11 + 19 + 57 + 25 + 8 + 48 + 22 = 5 + 11 + 19 + 57 + 25 + 8 + 48 + 22

=195

Major Differences

S no.C-SCANSSTF
1.The C-SCAN algorithm can only handle queries in one way at a timeThe SSTF algorithm, on the other hand, can handle requests in both directions.  
2.In terms of average waiting and reaction time, the C-SCAN algorithm has a low variance.The SSTF disc scheduling technique, on the other hand, has a wide range of response times and average waiting times.
3.More seek time is caused by the C-SCAN disc scheduling method.The SSTF disc scheduling technique, on the other hand, bears the overhead of locating the nearest request.
4.Requests would never be denied due to the C-SCAN disc scheduling method.The SSTF disc scheduling technique, on the other hand, has the potential to create starvation.