Name __________________________

CSE451            FINAL EXAM             June 11, 1997     8:30-10-20
 

Closed Book. Write your name at the top of each page.

Five (5) Questions. Each question is worth the same number of points.

________________________________________________________________

1. Explain briefly the following concepts or objects.

a) operating system kernel

b) test-and-set instruction

c) process control block (PCB)

d) semaphore

e) demand paging
 

2. Write a Hoare monitor that implements a synchronous send and receive. Your monitor should have two procedures:

send(in x: message) : Send message x.

receive(out t: message): Receive the next message in t.

A process blocks on a send until another process issues a receive or unless an unmatched receive has been previously issued. Similarly, a process will block on a receive unless a send is pending or until a send is issued. The sender and receiver then continue (are unblocked) at approximately the same time.
(Imagine the monitor as a zero-slot buffer, or the send and receive as doing a rendezvous).
 

3. Suppose that monitors may be nested; i.e., that a procedure of one monitor may call procedures of other monitors.

a) Explain how the unrestricted definition and use of nested monitors can cause deadlock.

b) How could one detect that a deadlock caused by nested monitors has occurred?

c) Describe a method for preventing deadlock on nested monitors and argue briefly why your prevention method works.
 

4. a) What is the disk scheduling problem?

b) Describe and compare the following three (3) methods for disk head scheduling: First-Come, First-Served (FCFS)

Shortest-Seek-Time-First (SSTF)

Circular Scan (C-SCAN)
 

5. a) What information appears (or is pointed at) typically in a file descriptor (also called file control block)?

b) Describe and compare the Unix i-node and the B-tree methods for organizing files.