hw04Solutions

# hw04Solutions - 1 3 5 6 2 7 4 8 2. Calculate the total head...

This preview shows page 1. Sign up to view the full content.

CS 411 Operating Systems II Spring 2009 Homework Assignment #4 Solutions Given a disk drive with 5000 cylinders, numbered 0 to 4999. Assume that the disk head is positioned at cylinder 1023, and the previous request was at cylinder 1088. (Note: this means that the head is currently moving in decreasing order of cylinder number.) The table below shows a reference string (i.e., a queue of disk I/O requests by cylinder locations in the order received ). Note: Here’s a table of “distances” Request # 1 2 3 4 5 6 7 8 Cylinder # 1106 4192 1515 138 1672 2960 120 861 1. Obviously, FCFS would handle the requests in the same order as they were received. List the request numbers in handling-order for the other disk-scheduling algorithms. Algorithm Handling-Order FCFS 1 2 3 4 5 6 7 8 SSTF 1 8 3 5 6 2 4 7 LOOK (elevator) 8 4 7 1 3 5 6 2 C-LOOK
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 3 5 6 2 7 4 8 2. Calculate the total head movement required by each algorithm. Show your work. Algorithm Total Head Movement (Cylinders) FCFS 83+3086+2677+1377+1534+1288+2840+741 = 13,626 SSTF 83+245+654+157+1288+1232+4054+18 = 7731 LOOK 162+723+18+986+409+157+1288+1232 = 4975 C-LOOK 83+409+157+1288+1232+4072+18+723 = 7982 3. Suppose that all requests are for only one block. The transfer rate is 1000 blocks per second (i.e., 1 ms per block). The average seek time is 0.004 ms per cylinder distance. The disk rotates at 10,000 RPM (i.e., the average rotational latency is 3 ms). Calculate the expected time for each algorithm to handle the request queue. Based on the answers to #2, the time is: (Total_head_movement x 0.004) + (8 x (3 + 1)) ms Algorithm Expected Time(ms) FCFS 86.504 ms SSTF 62.924 ms LOOK 51.9 ms C-LOOK 63.928 ms...
View Full Document

## This note was uploaded on 06/28/2009 for the course CS 411 taught by Professor Staff during the Spring '08 term at Oregon State.

Ask a homework question - tutors are online