Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

Chapter 6. Performance > Exercises - Pg. 362

362 CHAPTER 6 Performance to transport people from floor to floor in buildings. With shortest-seek-first, the total seek time is 108t: request Seek 1 Seek 2 Seek 3 Seek 4 Seek 5 Total Movement 0 0 0 5 5 1 1 90 90 100 Time 0t 5t 4t 89t 10t 108t With the elevator algorithm, the total seek latency is 199t: request Seek 1 Seek 2 Seek 3 Seek 4 Seek 5 Total Movement 0 0 0 5 5 90 90 100 100 1 Time 0t 5t 85t 10t 99t 199t Many disk controllers use a combination of the shortest-seek-first algorithm and the elevator algorithm. When processing requests, for a while they use the shortest- seek algorithm to choose requests, minimizing seek time, but then switch to the ele- vator algorithm to avoid starving requests for more distant tracks. For example, if the controller performs the request for track 1 first, starts seeking into the direction of 90, but at track 5 another request for track 1 comes in, then shortest-seek-first would go back to track 1. Since this sequence of events may repeat forever, the disk control- ler may never serve the request for tracks 90 and 100. By bounding the time that disk controllers perform shortest-seek-first and then switching to the elevator algorithm, requests for the distant tracks will also be served. This method is fine for disk systems, since the primary objective is to maximize total throughput, and thus delaying one request over another is acceptable. In a building, however, people do not want to have long delays, and therefore for buildings the elevator algorithm is better. exerCISeS 6.1 Suppose a processor has a clock rate of 100 megahertz. The time required to retrieve a word from the cache is 1 nanosecond, and the time required to retrieve a word not in the cache is 101 nanoseconds.