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

Suppose that process P is ready, and the scheduler decides to resume
running it. How does it determine the address of the next instruction
to run in P?

Problem 3

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 4

(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: