CMSC 412 Midterm #1 (Spring 2002)

 

1.)                 CPU Scheduling (20 points)

a)                   Explain why Round-Robin scheduling tends to favor CPU bound processes over I/O bound ones.

b)                   CPU scheduling quanta have remained about the same over the past 20 years, but processors are now over 1,000 times faster. Why haven’t CPU scheduling quanta changed?

c)                   List 4 events that might occur to cause the kernel to context switch from one user process to another.

2.)                 (10 points)  Explain how a process differs from a thread.

3.)                 (20 points) Given a system that provides binary semaphores (semaphores whose values is either 0 or 1).  Show the code to implement counting semaphores using binary semaphores.

counting:

 Vcounting:

4.)                  (15 Points) Deadlock

a)                   List the four necessary conditions for deadlock

b)                   Explain how the Resource-Request (Banker’s) algorithm prevents deadlock.

5.)                  (20 points) Project

a)                   After you setup a user mode process, do you still need the stack created for kernel mode threads?  Explain your answer.

b)                   What would happen if your _Entry function in libuser.a returns rather than calling Exit.

6.)                  (15 points)

a)                   Explain the difference between policy and mechanism in an operating system.  Given an example of each.

b)                   One of the usability goals for an operating system is “proportionality.” Explain what is meant by this term.

Web Accessibility