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

Sstf scheduling.50

  • 1.
    SSTF, SCAN, C-SCANalgorithms 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 lastclass, you have learnt: - Disk scheduling its need – The FCFS disk scheduling algorithm – Advantages – Disadvantages http://raj-os.blogspot.in/ 3
  • 4.
    Objectives On Completion ofthis 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 • TheShortest-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 • Minimalseek 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 • Considerfor 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 • Ifthe 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 Initialhead position http://raj-os.blogspot.in/ 9
  • 10.
    SSTF Scheduling Head movementfrom 53 to 65th track http://raj-os.blogspot.in/ 10
  • 11.
    SSTF Scheduling Head movementfrom 65th to 67th track http://raj-os.blogspot.in/ 11
  • 12.
    SSTF Scheduling Head movementfrom 67th to 37th track http://raj-os.blogspot.in/ 12
  • 13.
    SSTF Scheduling Head movementfrom 37th track to 14th track http://raj-os.blogspot.in/ 13
  • 14.
    SSTF Scheduling Head movement14th track to 98th track http://raj-os.blogspot.in/ 14
  • 15.
    SSTF Scheduling Head movementfrom 98th to 122 track http://raj-os.blogspot.in/ 15
  • 16.
    SSTF Scheduling Head movementfrom 122 to 124 http://raj-os.blogspot.in/ 16
  • 17.
    SSTF Scheduling Head movementfrom 124 to 183rd track http://raj-os.blogspot.in/ 17
  • 18.
  • 19.
    SSTF Scheduling Advantages • Itis substantial improvement over FCFS • It is a essential form of Shortest Job First Scheduling http://raj-os.blogspot.in/ 19
  • 20.
    SSTF Scheduling Disadvantages • Itmay 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 SSTFScheduling 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 SCANScheduling 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 Schedulingprovides 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