sol-Tutorial6

sol-Tutorial6 - No. of sectors used to store f1 in disk 1 =...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Question 1 Given: * 200 tracks and track 0 is the outermost track * Seek time is 1 time unit per track * Service time is 2 time unit per access * Use SCAN algorithm with the initial position is track 0; this implies the direction of movement is towards inner tracks. Time Request Location Target track 0 R1 arrive 0 15 12 R2 arrive 12 15 15 15 15 17 R1 finish 15 150 102 100 150 130 R3 arrive 128 150 152 150 150 154 R2 finish 150 100 203 199 100 302 100 100 304 R3 finish 100 Request Waiting time R1 15 0 = 15 R2 152 12 = 140 R3 302 130 = 172 Average waiting time = (15 + 140 + 172)/3 = 109 time units Question 2 Given: * files size = 100 KiB = 100 × 2 10 bytes * data blocks are spread randomly in the disks * Sector size of disk 1 = 1 KiB * Sector size of disk 2 = 4 KiB * Average seek time = 10 ms
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
* Average rational latency = 5 ms * Transfer time is modeled by ± ² ³ ´ µ ± µ · ¸ The no. of bytes on a track is the same on both disks = 32 × 1 KiB = 8 × 4 KiB = 32 KiB
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: No. of sectors used to store f1 in disk 1 = 100 KiB / 1 KiB = 100 sectors. To sequentially read f1 , we have to read the file sector by sector, starting from the first sector. Since the data blocks are distributed randomly, this implies the sectors used for storing the data blocks are also distributed randomly. The time to locate 100 sectors = 100 × (time to seek a random track + time to rotate the disk to position the read-write head) = 100 × (10 ms + 5 ms) = 1500 ms The time to read 100 sectors = 100 × (2 × 5 ms × 1 KiB /32 KiB) = 31.25 ms The time to read f1 = 1500 ms + 31.25 ms = 1531.25 ms = 1.53 seconds For reading f2 , No. of sectors used to store f2 in disk 2 = 100 KiB / 4 KiB = 25 sectors. Time to locate 25 sectors = 25 × 15 ms = 375 ms Time to read 25 sectors = 25 x (2 × 5 ms × 4 KiB /32 KiB) = 31.25 ms Time to read f2 = 375 ms + 31.25 ms = 406.25 ms...
View Full Document

This note was uploaded on 12/01/2010 for the course CS 2342 taught by Professor Dr during the Spring '10 term at HKU.

Page1 / 2

sol-Tutorial6 - No. of sectors used to store f1 in disk 1 =...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online