12.07.2015 Views

A Practical Introduction to Data Structures and Algorithm Analysis

A Practical Introduction to Data Structures and Algorithm Analysis

A Practical Introduction to Data Structures and Algorithm Analysis

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Sec. 8.2 Disk Drives 283of the data on disk. Likewise, when writing <strong>to</strong> a particular logical byte positionwith respect <strong>to</strong> the beginning of the file, this position must be converted by thefile manager in<strong>to</strong> the corresponding physical location on the disk. To gain someappreciation for the the approximate time costs for these operations, you need <strong>to</strong>underst<strong>and</strong> the physical structure <strong>and</strong> basic workings of a disk drive.Disk drives are often referred <strong>to</strong> as direct access s<strong>to</strong>rage devices. This meansthat it takes roughly equal time <strong>to</strong> access any record in the file. This is in contrast<strong>to</strong> sequential access s<strong>to</strong>rage devices such as tape drives, which require the tapereader <strong>to</strong> process data from the beginning of the tape until the desired position hasbeen reached. As you will see, the disk drive is only approximately direct access:At any given time, some records are more quickly accessible than others.8.2.1 Disk Drive ArchitectureA hard disk drive is composed of one or more round platters, stacked one on <strong>to</strong>p ofanother <strong>and</strong> attached <strong>to</strong> a central spindle. Platters spin continuously at a constantrate. Each usable surface of each platter is assigned a read/write head or I/Ohead through which data are read or written, somewhat like the arrangement ofa phonograph player’s arm “reading” sound from a phonograph record. Unlike aphonograph needle, the disk read/write head does not actually <strong>to</strong>uch the surface ofa hard disk. Instead, it remains slightly above the surface, <strong>and</strong> any contact duringnormal operation would damage the disk. This distance is very small, much smallerthan the height of a dust particle. It can be likened <strong>to</strong> a 5000-kilometer airplane tripacross the United States, with the plane flying at a height of one meter!A hard disk drive typically has several platters <strong>and</strong> several read/write heads, asshown in Figure 8.2(a). Each head is attached <strong>to</strong> an arm, which connects <strong>to</strong> theboom. The boom moves all of the heads in or out <strong>to</strong>gether. When the heads are insome position over the platters, there are data on each platter directly accessible <strong>to</strong>each head. The data on a single platter that are accessible <strong>to</strong> any one position ofthe head for that platter are collectively called a track, that is, all data on a platterthat are a fixed distance from the spindle, as shown in Figure 8.2(b). The collectionof all tracks that are a fixed distance from the spindle is called a cylinder. Thus, acylinder is all of the data that can be read when the arms are in a particular position.Each track is subdivided in<strong>to</strong> sec<strong>to</strong>rs. Between each sec<strong>to</strong>r there are intersec<strong>to</strong>rgaps in which no data are s<strong>to</strong>red. These gaps allow the read head <strong>to</strong> recognizethe end of a sec<strong>to</strong>r. Note that each sec<strong>to</strong>r contains the same amount of data.Because the outer tracks have greater length, they contain fewer bits per inch th<strong>and</strong>o the inner tracks. Thus, about half of the potential s<strong>to</strong>rage space is wasted, becauseonly the innermost tracks are s<strong>to</strong>red at the highest possible data density. This

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!