seconds, one microsecond (ms) is 106 seconds, and one millisecond (ms) is 103 seconds.

Team-FLY

1.2 Time and Speed

Operating systems manage system resources: processors, memory and I/O devices including keyboards, monitors , printers, mouse devices, disks, tapes, CD-ROMs and network interfaces. The convoluted way operating systems appear to work derives from the characteristics of peripheral devices, particularly their speed relative to the CPU or processor. Table 1.1 lists typical processor, memory and peripheral times in nanoseconds. The third column shows these speeds slowed down by a factor of 2 billion to give the time scaled in human terms. The scaled time of one operation per second is roughly the rate of the old mechanical calculators from fifty years ago.

Table 1.1. Typical times for components of a computer system. One nanosecond (ns) is 10 “9 seconds, one microsecond ( m s) is 10 “6 seconds, and one millisecond (ms) is 10 “3 seconds.

item

time

scaled time in human terms (2 billion times slower)

processor cycle

0.5 ns

(2 GHz)

1

second

cache access

1 ns

(1 GHz)

2

seconds

memory access

15 ns

 

30

seconds

context switch

5,000 ns

(5 m s)

167

minutes

disk access

7,000,000 ns

(7 ms)

162

days

quantum

100,000,000 ns

(100 ms)

6.3

years

Disk drives have improved, but their rotating mechanical nature limits their performance. Disk access times have not decreased exponentially. The disparity between processor and disk access times continues to grow; as of 2003 the ratio is roughly 1 to 14,000,000 for a 2-GHz processor. The cited speeds are a moving target, but the trend is that processor speeds are increasing exponentially, causing an increasing performance gap between processors and peripherals.

The context-switch time is the time it takes to switch from executing one process to another. The quantum is roughly the amount of CPU time allocated to a process before it has to let another process run. In a sense, a user at a keyboard is a peripheral device. A fast typist can type a keystroke every 100 milliseconds . This time is the same order of magnitude as the process scheduling quantum, and it is no coincidence that these numbers are comparable for interactive timesharing systems.

Exercise 1.1

A modem is a device that permits a computer to communicate with another computer over a phone line. A typical modem is rated at 57,600 bps, where bps means "bits per second." Assuming it takes 8 bits to transmit a byte, estimate the time needed for a 57,600 bps modem to fill a computer screen with 25 lines of 80 characters . Now consider a graphics display that consists of an array of 1024 by 768 pixels. Each pixel has a color value that can be one of 256 possible colors. Assume such a pixel value can be transmitted by modem in 8 bits. What compression ratio is necessary for a 768-kbps DSL line to fill a screen with graphics as fast as a 57,600-bps modem can fill a screen with text?

Answer:

Table 1.2 compares the times. The text display has 80 x 25 = 2000 characters so 16,000 bits must be transmitted. The graphics display has 1024 x 768 = 786,432 pixels so 6,291,456 bits must be transmitted. The estimates do not account for compression or for communication protocol overhead. A compression ratio of about 29 is necessary!

Table 1.2. Comparison of time estimates for filling a screen.

modem type

bits per second

time needed to display

text

graphics

1979 telephone modem

300

1 minute

6 hours

1983 telephone modem

2,400

6 seconds

45 minutes

current telephone modem

57,600

0.28 seconds

109 seconds

current DSL modem

768,000

0.02 seconds

8 seconds

Team-FLY


Unix Systems Programming
UNIX Systems Programming: Communication, Concurrency and Threads
ISBN: 0130424110
EAN: 2147483647
Year: 2003
Pages: 274

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net