13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Exercises 183used to transmit keys for the one-time pad. What do you think of this idea? Is itsecure? Is it efficient?5. Should a recipient of a duplicate message acknowledge it or not?6. How long would it take to print the contents of a floppy disk on a dot-matrixprinter, assuming that blanks take as long to print as any other character?7. Compare the FCFS, SSF, Look, and C-Look disk-head scheduling policies bysimulating the following access request list. For each policy, compute the averageand the standard deviation of the time required to service requests. Assume thatthe disk starts at track 1; that there are 200 tracks; that a seek takes (20 + 0.1 . T )milliseconds, where T is the number of tracks of motion; that rotational latency is 8milliseconds; and that servicing the request itself takes 2 milliseconds.Time(ms) 0 23 25 29 35 45 57 83 88 95Track 45 132 20 23 198 170 180 78 73 1508. To what extent does the theory of disk-head scheduling apply to magnetic tapes?9. The text suggests that the main-store cache of device blocks can be managed by anLRU mechanism. Why is LRU more appropriate here but NUR more appropriatefor page replacement?10. A program needs to use a circular buffer pool, but the programmer is unsure howmany buffers are needed. The program is expected to output data according to thisrepetitive pattern:Virtual time Number of bytes1 50 2 500 5 1000The program will go through 100 iterations, each taking 5 seconds, before finishing.Assume that buffers are 100 bytes long and that the device driver responsiblefor the output can transfer 4 buffers per second. For a buffer pool of 1, 2, 3, 4, and5 buffers, how long will it take for the program to finish (a) the first iteration, (b)the second iteration, and (c) the last iteration? By ‘‘finishing’’ we mean placingthe output data in buffers; the device driver is then responsible for transferring thedata to the device.11. Suggest guidelines to programmers for choosing the number of buffers they shouldallocate in circular buffer pools.12. The text suggests that a process using circular buffer pools should execute a Waitservice call to acquire a buffer and submit a Write (for output buffers) orFreeBuffer (for input buffers) to release the buffer. Suggest ways in which thesecalls can be safely avoided and comment on the efficiency of your solution. (Hint:Consider tricks with virtual store.)

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

Saved successfully!

Ooh no, something went wrong!