All Exams Test series for 1 year @ ₹349 only
Question

Consider the following disc Queue with requests for I/O to block on cylinders:
45, 81, 185, 33, 175, 99, 150, 77
(Consider that the head starts from location 58)

What will be the total head movement of cylinders for the SSTF disc Scheduling technique ?

The correct answer is
177

Understanding the SSTF Disc Scheduling Technique

The Shortest Seek Time First (SSTF) algorithm is a disk scheduling method designed to minimize the total seek time. It selects the request that is closest to the current head position first.

Calculating Total Head Movement with SSTF

We need to calculate the total movement of the disk head based on the given requests and the starting position using the SSTF algorithm.

Initial Setup:

  • Initial head position: 58
  • Requests: {45, 81, 185, 33, 175, 99, 150, 77}

Step-by-Step Execution of SSTF:

Step 1: Initial Move

  • Current Head Position: 58
  • Distances to pending requests:
    • $|58 - 45| = 13$
    • $|58 - 81| = 23$
    • $|58 - 185| = 127$
    • $|58 - 33| = 25$
    • $|58 - 175| = 117$
    • $|58 - 99| = 41$
    • $|58 - 150| = 92$
    • $|58 - 77| = 19$
  • The closest request is 45 (distance 13).
  • Move head from 58 to 45.
  • Movement: 13 cylinders.
  • Total Movement so far: 13.
  • Remaining Requests: {81, 185, 33, 175, 99, 150, 77}

Step 2: Second Move

  • Current Head Position: 45
  • Distances to pending requests:
    • $|45 - 81| = 36$
    • $|45 - 185| = 140$
    • $|45 - 33| = 12$
    • $|45 - 175| = 130$
    • $|45 - 99| = 54$
    • $|45 - 150| = 105$
    • $|45 - 77| = 32$
  • The closest request is 33 (distance 12).
  • Move head from 45 to 33.
  • Movement: 12 cylinders.
  • Total Movement so far: $13 + 12 = 25$.
  • Remaining Requests: {81, 185, 175, 99, 150, 77}

Step 3: Third Move

  • Current Head Position: 33
  • Distances to pending requests:
    • $|33 - 81| = 48$
    • $|33 - 185| = 152$
    • $|33 - 175| = 142$
    • $|33 - 99| = 66$
    • $|33 - 150| = 117$
    • $|33 - 77| = 44$
  • The closest request is 77 (distance 44).
  • Move head from 33 to 77.
  • Movement: 44 cylinders.
  • Total Movement so far: $25 + 44 = 69$.
  • Remaining Requests: {81, 185, 175, 99, 150}

Step 4: Fourth Move

  • Current Head Position: 77
  • Distances to pending requests:
    • $|77 - 81| = 4$
    • $|77 - 185| = 108$
    • $|77 - 175| = 98$
    • $|77 - 99| = 22$
    • $|77 - 150| = 73$
  • The closest request is 81 (distance 4).
  • Move head from 77 to 81.
  • Movement: 4 cylinders.
  • Total Movement so far: $69 + 4 = 73$.
  • Remaining Requests: {185, 175, 99, 150}

Step 5: Fifth Move

  • Current Head Position: 81
  • Distances to pending requests:
    • $|81 - 185| = 104$
    • $|81 - 175| = 94$
    • $|81 - 99| = 18$
    • $|81 - 150| = 69$
  • The closest request is 99 (distance 18).
  • Move head from 81 to 99.
  • Movement: 18 cylinders.
  • Total Movement so far: $73 + 18 = 91$.
  • Remaining Requests: {185, 175, 150}

Step 6: Sixth Move

  • Current Head Position: 99
  • Distances to pending requests:
    • $|99 - 185| = 86$
    • $|99 - 175| = 76$
    • $|99 - 150| = 51$
  • The closest request is 150 (distance 51).
  • Move head from 99 to 150.
  • Movement: 51 cylinders.
  • Total Movement so far: $91 + 51 = 142$.
  • Remaining Requests: {185, 175}

Step 7: Seventh Move

  • Current Head Position: 150
  • Distances to pending requests:
    • $|150 - 185| = 35$
    • $|150 - 175| = 25$
  • The closest request is 175 (distance 25).
  • Move head from 150 to 175.
  • Movement: 25 cylinders.
  • Total Movement so far: $142 + 25 = 167$.
  • Remaining Requests: {185}

Step 8: Final Move

  • Current Head Position: 175
  • Distance to pending request:
    • $|175 - 185| = 10$
  • The closest request is 185 (distance 10).
  • Move head from 175 to 185.
  • Movement: 10 cylinders.
  • Total Movement so far: $167 + 10 = 177$.
  • Remaining Requests: {}

Summary Table: SSTF Head Movement

Current Position Closest Request Seek Distance Total Movement
58 45 13 13
45 33 12 25
33 77 44 69
77 81 4 73
81 99 18 91
99 150 51 142
150 175 25 167
175 185 10 177

Conclusion

The total head movement for the SSTF disc scheduling technique, starting from cylinder 58 and servicing the requests {45, 81, 185, 33, 175, 99, 150, 77}, is 177 cylinders.

Was this answer helpful?

Important Questions from Disk Scheduling

  1. Which of the following is the time taken to move an access arm to a certain track on a disk?

  2. Move the Read/Write head of disk in or out to position on a correct track is known as ______.

  3. _______ is a process of lifting the process from memory and placing it on disk.

  4. Match List I with List II
    List IList II
    A. RAID Level 2I. Block interleaved distribution parity
    B. RAID Level 3II. Also known as P+Q redundancy Scheme
    C. RAID Level 5III. Bit interleaved parity
    D. RAID Level 6IV. Also known as Memory style error correcting code organization

    Choose the correct answer from the options given below:
  5. What shall be the total head movement of cylinders if the FCFS disc scheduling method is used ?
Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App