Sample midterm exam

Problem 1

In a multi-process system, at any moment every process is in one of three states: running, ready, or blocked. What are the transitions between these states, and when do they occur?

Problem 2:

Explain briefly (1 or 2 sentences) the major difference between a thread and a process. Name one type of state that is recorded in a thread table. Name one type of information that is saved in a process table but not in a thread table.

Problem 3

(Multiple choice: Give all correct answers) Suppose there are two processes, A and B, which share semaphors R and S. At the starting time, R = 0, S = 1. A and B are entering the sections of code shown below:
Process A:                           Process B:
P(R);                                Operation B.1;
P(S);                                V(R);
Operation A.1;                       Operation B.2;
V(S);                                P(S);
Operation A.2;                       Operation B.3;
V(R);                                V(S);

Which of the following statements are true (more than one may be true:)

Problem 4:

What is spooling, and why is it used?

Problem 5

(Multiple choice: 1 correct answer.) A ``critical section'' of code is

Problem 6:

(Multiple choice: Give all correct answers) A given OS uses round-robin scheduling. The time quantum is Q and the time needed for context switch is C. Over an extended time period T, which is much greater than Q+C, there are N active processes; no processes begin or terminate during this period. Assume further that all these processes fit together in memory; no swapping or paging is needed. Which of the following statements are true:

Problem 7

Suppose that jobs arrive according to the following schedule.
Process   Starting Time    Run Time
  A           0              12
  B           3               7
  C           6               2
  D           8               5
  E           9               2
  F          12              12
Trace the progress of the system if the scheduler used is