SlideShare a Scribd company logo
1 of 26
SSTF, SCAN, C-SCAN algorithms




                      http://raj-os.blogspot.in/   1
HOME     PREVIOUS TOPIC NEXT
PREVIOUS QUESTION PAPERS FOR OS
CPP TUTORIALS




        http://raj-os.blogspot.in/   2
Recap

In the last class, you have learnt:

    - Disk scheduling its need

    – The FCFS disk scheduling algorithm

    – Advantages

    – Disadvantages

                           http://raj-os.blogspot.in/   3
Objectives

On Completion of this period, you would be able to

know :
• SSTF , SCAN, C-SCAN disk scheduling algorithm

• Advantages

• Disadvantages



                     http://raj-os.blogspot.in/      4
SSTF Scheduling

• The Shortest-Seek-Time-First Scheduling

  – Services the requests at the current head position

  – Before moving the head far away




                    http://raj-os.blogspot.in/           5
SSTF Scheduling

• Minimal seek time is the criteria for selection of
  requests

   – Seek time is proportional to the track difference between
     requests

   – Head is moved to the closest track in the request queue



                        http://raj-os.blogspot.in/               6
SSTF Scheduling

• Consider for example an ordered disk queue with
  requests involving
   – Tracks 98, 183, 37, 122, 14, 124, 65, 67

   – Head pointer 53

• The request queue (0-199)




                        http://raj-os.blogspot.in/   7
SSTF Scheduling

• If the disk head is initially at cylinder 53,

   – it will first move from 53 to 65,

   – then to next closest position 67, 37, 14, 98, 122, 124
     and 183 as shown in the next slides


• The total head movement of 236 tracks

                        http://raj-os.blogspot.in/            8
SSTF Scheduling




 Initial head position
  http://raj-os.blogspot.in/   9
SSTF Scheduling




Head movement from 53 to 65th track
        http://raj-os.blogspot.in/    10
SSTF Scheduling




Head movement from 65th to 67th track
        http://raj-os.blogspot.in/      11
SSTF Scheduling




Head movement from 67th to 37th track
        http://raj-os.blogspot.in/      12
SSTF Scheduling




Head movement from 37th track to 14th track
            http://raj-os.blogspot.in/        13
SSTF Scheduling




Head movement 14th track to 98th track
            http://raj-os.blogspot.in/   14
SSTF Scheduling




Head movement from 98th to 122 track
          http://raj-os.blogspot.in/   15
SSTF Scheduling




Head movement from 122 to 124
       http://raj-os.blogspot.in/   16
SSTF Scheduling




Head movement from 124 to 183rd track
          http://raj-os.blogspot.in/    17
http://raj-os.blogspot.in/   18
SSTF Scheduling


Advantages

• It is substantial improvement over FCFS
• It is a essential form of Shortest Job First
  Scheduling




                    http://raj-os.blogspot.in/   19
SSTF Scheduling


Disadvantages

• It may cause starvation of some requests

• It is not optimal

• The total head movement can be further reduced



                      http://raj-os.blogspot.in/   20
Summary


In this class, you have learnt:
• The SSTF, SCAN,C-SCAN Scheduling

• Advantages

• Disadvantages




                     http://raj-os.blogspot.in/   21
Frequently Asked Questions

1.   List the advantages and disadvantages of SSTF,SCAN, C-SCAN

     algorithms

2.   Compare SCAN and C-SCAN scheduling algorithm

3.   Explain SSTF scheduling algorithm with the help an example

4.   Explain SCAN scheduling algorithm with the help an example

5.   Explain C-SCAN scheduling algorithm with the help an example




                           http://raj-os.blogspot.in/               22
Quiz

1. The SSTF Scheduling is based on Minimal seek
   time criteria for selection of requests [T/F]
    TRUE
2. The SSTF Scheduling may cause starvation of some
   requests [T/F]
    TRUE




                    http://raj-os.blogspot.in/        23
Quiz

3. The SCAN Scheduling algorithm is also called
   elevator algorithm [T/F]
   TRUE

4. The SCAN Scheduling algorithm doesn't provide
   uniform wait time
    TRUE



                    http://raj-os.blogspot.in/     24
Quiz
5. C-SCAN Scheduling provides uniform waiting time
  than SCAN Scheduling [T/F]
   TRUE

6. C-SCAN Scheduling treats the cylinders as a circular
  list that wraps around from the last cylinder to the
  first one. [T/F]
   TRUE

                      http://raj-os.blogspot.in/         25
Other subject materials

•   Web designing
•   Micro processors
•   C++ tutorials
•   java

home


                 http://raj-os.blogspot.in/   26

More Related Content

What's hot

Operating System 5
Operating System 5Operating System 5
Operating System 5
tech2click
 
C scan scheduling 50 2
C scan scheduling 50 2C scan scheduling 50 2
C scan scheduling 50 2
myrajendra
 

What's hot (20)

Operating System Scheduling Algorithms
Operating System Scheduling AlgorithmsOperating System Scheduling Algorithms
Operating System Scheduling Algorithms
 
Operating System 5
Operating System 5Operating System 5
Operating System 5
 
Implementing Useful Clock Skew Using Skew Groups
Implementing Useful Clock Skew Using Skew GroupsImplementing Useful Clock Skew Using Skew Groups
Implementing Useful Clock Skew Using Skew Groups
 
CPU Non-Preemptive Scheduling
CPU Non-Preemptive Scheduling CPU Non-Preemptive Scheduling
CPU Non-Preemptive Scheduling
 
Floyd Warshall algorithm easy way to compute - Malinga
Floyd Warshall algorithm easy way to compute - MalingaFloyd Warshall algorithm easy way to compute - Malinga
Floyd Warshall algorithm easy way to compute - Malinga
 
Shortest Job First
Shortest Job FirstShortest Job First
Shortest Job First
 
Clock Skew 1
Clock Skew 1Clock Skew 1
Clock Skew 1
 
Job scheduling
Job schedulingJob scheduling
Job scheduling
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Disk structure
Disk structureDisk structure
Disk structure
 
C scan scheduling 50 2
C scan scheduling 50 2C scan scheduling 50 2
C scan scheduling 50 2
 
Real time operating systems (rtos) concepts 4
Real time operating systems (rtos) concepts 4Real time operating systems (rtos) concepts 4
Real time operating systems (rtos) concepts 4
 
Disk Scheduling Algorithm in Operating System
Disk Scheduling Algorithm in Operating SystemDisk Scheduling Algorithm in Operating System
Disk Scheduling Algorithm in Operating System
 
Branch & bound
Branch & boundBranch & bound
Branch & bound
 
Rtos
RtosRtos
Rtos
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
 
09 placement
09 placement09 placement
09 placement
 
SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS
 
Advanced computer architechture -Memory Hierarchies and its Properties and Type
Advanced computer architechture -Memory Hierarchies and its Properties and TypeAdvanced computer architechture -Memory Hierarchies and its Properties and Type
Advanced computer architechture -Memory Hierarchies and its Properties and Type
 
Understanding cts log_messages
Understanding cts log_messagesUnderstanding cts log_messages
Understanding cts log_messages
 

Similar to Sstf scheduling.50

Fcfs scheduling
Fcfs schedulingFcfs scheduling
Fcfs scheduling
myrajendra
 
Disk scheduling algorithm.52
Disk scheduling algorithm.52Disk scheduling algorithm.52
Disk scheduling algorithm.52
myrajendra
 
Disk scheduling.49
Disk scheduling.49Disk scheduling.49
Disk scheduling.49
myrajendra
 

Similar to Sstf scheduling.50 (20)

Fcfs scheduling
Fcfs schedulingFcfs scheduling
Fcfs scheduling
 
Disk scheduling algorithm.52
Disk scheduling algorithm.52Disk scheduling algorithm.52
Disk scheduling algorithm.52
 
Disk scheduling.49
Disk scheduling.49Disk scheduling.49
Disk scheduling.49
 
I/O buffering & disk scheduling
I/O buffering & disk schedulingI/O buffering & disk scheduling
I/O buffering & disk scheduling
 
Device Management
Device ManagementDevice Management
Device Management
 
Process scheduling algorithms
Process scheduling algorithmsProcess scheduling algorithms
Process scheduling algorithms
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Scheduling Algorithms-Examples.pptx
Scheduling Algorithms-Examples.pptxScheduling Algorithms-Examples.pptx
Scheduling Algorithms-Examples.pptx
 
programming .pptx
programming .pptxprogramming .pptx
programming .pptx
 
Round-ribon algorithm presntation
Round-ribon algorithm presntationRound-ribon algorithm presntation
Round-ribon algorithm presntation
 
Ch05 cpu-scheduling
Ch05 cpu-schedulingCh05 cpu-scheduling
Ch05 cpu-scheduling
 
Operating system
Operating systemOperating system
Operating system
 
Process scheduling : operating system ( Btech cse )
Process scheduling : operating system ( Btech cse )Process scheduling : operating system ( Btech cse )
Process scheduling : operating system ( Btech cse )
 
CPU Scheduling Part-III.pdf
CPU Scheduling Part-III.pdfCPU Scheduling Part-III.pdf
CPU Scheduling Part-III.pdf
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Tn6 facility layout
Tn6 facility layoutTn6 facility layout
Tn6 facility layout
 
Tn6 facility+layout
Tn6 facility+layoutTn6 facility+layout
Tn6 facility+layout
 
Sucet os module_5_notes
Sucet os module_5_notesSucet os module_5_notes
Sucet os module_5_notes
 
ch5_EN_CPUSched.pdf
ch5_EN_CPUSched.pdfch5_EN_CPUSched.pdf
ch5_EN_CPUSched.pdf
 
Disk Scheduling.pptx
Disk Scheduling.pptxDisk Scheduling.pptx
Disk Scheduling.pptx
 

More from myrajendra (20)

Fundamentals
FundamentalsFundamentals
Fundamentals
 
Data type
Data typeData type
Data type
 
Hibernate example1
Hibernate example1Hibernate example1
Hibernate example1
 
Jdbc workflow
Jdbc workflowJdbc workflow
Jdbc workflow
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc drivers
 
3 jdbc api
3 jdbc api3 jdbc api
3 jdbc api
 
4 jdbc step1
4 jdbc step14 jdbc step1
4 jdbc step1
 
Dao example
Dao exampleDao example
Dao example
 
Sessionex1
Sessionex1Sessionex1
Sessionex1
 
Internal
InternalInternal
Internal
 
3. elements
3. elements3. elements
3. elements
 
2. attributes
2. attributes2. attributes
2. attributes
 
1 introduction to html
1 introduction to html1 introduction to html
1 introduction to html
 
Headings
HeadingsHeadings
Headings
 
Forms
FormsForms
Forms
 
Css
CssCss
Css
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Starting jdbc
Starting jdbcStarting jdbc
Starting jdbc
 

Sstf scheduling.50

  • 1. SSTF, SCAN, C-SCAN algorithms http://raj-os.blogspot.in/ 1
  • 2. HOME PREVIOUS TOPIC NEXT PREVIOUS QUESTION PAPERS FOR OS CPP TUTORIALS http://raj-os.blogspot.in/ 2
  • 3. Recap In the last class, you have learnt: - Disk scheduling its need – The FCFS disk scheduling algorithm – Advantages – Disadvantages http://raj-os.blogspot.in/ 3
  • 4. Objectives On Completion of this period, you would be able to know : • SSTF , SCAN, C-SCAN disk scheduling algorithm • Advantages • Disadvantages http://raj-os.blogspot.in/ 4
  • 5. SSTF Scheduling • The Shortest-Seek-Time-First Scheduling – Services the requests at the current head position – Before moving the head far away http://raj-os.blogspot.in/ 5
  • 6. SSTF Scheduling • Minimal seek time is the criteria for selection of requests – Seek time is proportional to the track difference between requests – Head is moved to the closest track in the request queue http://raj-os.blogspot.in/ 6
  • 7. SSTF Scheduling • Consider for example an ordered disk queue with requests involving – Tracks 98, 183, 37, 122, 14, 124, 65, 67 – Head pointer 53 • The request queue (0-199) http://raj-os.blogspot.in/ 7
  • 8. SSTF Scheduling • If the disk head is initially at cylinder 53, – it will first move from 53 to 65, – then to next closest position 67, 37, 14, 98, 122, 124 and 183 as shown in the next slides • The total head movement of 236 tracks http://raj-os.blogspot.in/ 8
  • 9. SSTF Scheduling Initial head position http://raj-os.blogspot.in/ 9
  • 10. SSTF Scheduling Head movement from 53 to 65th track http://raj-os.blogspot.in/ 10
  • 11. SSTF Scheduling Head movement from 65th to 67th track http://raj-os.blogspot.in/ 11
  • 12. SSTF Scheduling Head movement from 67th to 37th track http://raj-os.blogspot.in/ 12
  • 13. SSTF Scheduling Head movement from 37th track to 14th track http://raj-os.blogspot.in/ 13
  • 14. SSTF Scheduling Head movement 14th track to 98th track http://raj-os.blogspot.in/ 14
  • 15. SSTF Scheduling Head movement from 98th to 122 track http://raj-os.blogspot.in/ 15
  • 16. SSTF Scheduling Head movement from 122 to 124 http://raj-os.blogspot.in/ 16
  • 17. SSTF Scheduling Head movement from 124 to 183rd track http://raj-os.blogspot.in/ 17
  • 19. SSTF Scheduling Advantages • It is substantial improvement over FCFS • It is a essential form of Shortest Job First Scheduling http://raj-os.blogspot.in/ 19
  • 20. SSTF Scheduling Disadvantages • It may cause starvation of some requests • It is not optimal • The total head movement can be further reduced http://raj-os.blogspot.in/ 20
  • 21. Summary In this class, you have learnt: • The SSTF, SCAN,C-SCAN Scheduling • Advantages • Disadvantages http://raj-os.blogspot.in/ 21
  • 22. Frequently Asked Questions 1. List the advantages and disadvantages of SSTF,SCAN, C-SCAN algorithms 2. Compare SCAN and C-SCAN scheduling algorithm 3. Explain SSTF scheduling algorithm with the help an example 4. Explain SCAN scheduling algorithm with the help an example 5. Explain C-SCAN scheduling algorithm with the help an example http://raj-os.blogspot.in/ 22
  • 23. Quiz 1. The SSTF Scheduling is based on Minimal seek time criteria for selection of requests [T/F] TRUE 2. The SSTF Scheduling may cause starvation of some requests [T/F] TRUE http://raj-os.blogspot.in/ 23
  • 24. Quiz 3. The SCAN Scheduling algorithm is also called elevator algorithm [T/F] TRUE 4. The SCAN Scheduling algorithm doesn't provide uniform wait time TRUE http://raj-os.blogspot.in/ 24
  • 25. Quiz 5. C-SCAN Scheduling provides uniform waiting time than SCAN Scheduling [T/F] TRUE 6. C-SCAN Scheduling treats the cylinders as a circular list that wraps around from the last cylinder to the first one. [T/F] TRUE http://raj-os.blogspot.in/ 25
  • 26. Other subject materials • Web designing • Micro processors • C++ tutorials • java home http://raj-os.blogspot.in/ 26