
CSI 4337 Review Sept. 18, 2006
1. Go through the steps that must take place in a context switch. Make sure that you
give the conditions under which a context switch could actually occur.
2. Define the term “System Call.” Give a list of the various system calls that could be
performed by a program.
3. Explain the concept of memory protection, and why it is needed.
4. What kinds of things get saved in a PCB? Why do I need a PCB in the first place?
5. Explain the concept of privileged instructions and explain why they are needed.
6. Give a solution to the bounded buffer problem.
7. How does a new process get created?
8. When your program is running, what is the OS doing?
9. Given the following processes and burst times, give a Gantt chart for each, compute
the average wait time, the average turn-around time, and the average response time
for the three algorithms, shortest remaining time first, first come first served, and
round robin with a quantum of 3.
Process Burst Time Arrival Time
P1 12 1
P2 2 2
P3 2 3
P4 7 7
P5 1 8
10. If the arrival times are all equal, which algorithm will minimize average wait time?
Why?
11. Explain priority scheduling. How is it usually implemented?
12. Given the following two processes, show how to protect the two statements with
TestAndSet and with semaphores.
Process 1 Process 2:
shared int S = 27; shared int S = 27;
… …
S = S+5; S = S-7;
13 In the above example, if I execute both processes with no protection, there are three
potential final values for S, assuming that both statements are executed once. (The
initial value of S is 27.) What are they, and how can they occur?