Operating System Qualifying Exam Spring 2000

1.

A complete definition of mutual exclusion has 4 criteria:
1) mutual exclusion
2) no speed or # CPUs assumptions
2) progress
3) bounded waiting (fairness)

No, the protocal fails on the "progress" critiria, since the person owns the token may doesnot want to enter the critical section. Hence, all other processes can be starvation.


2.

      0         5         10         15         20         25         30


P1 =====            =====

P2             ======

P3                                                  ============

P4                                      ======

3.

P2 Get M -------> P1
P3 Get M -------> P1
P1 Put M -------> P2
P1 Put M -------> P3
P2 Lock M ------> P1
P1 Grant M -----> P2
P1 Flush M -----> P3
P3 Get M -------> P1
P2 Release M ---> P1
P1 Grant M -----> P3
P1 Flush M -----> P2
P3 Release M ---> P1

4

page fault as *

                              * *        * *      * *       *
frame 1                  9 4 9 2 7 4 7 2 6 5 6 2 1

frame 2               2 2 9 4 9 2 7 4 7 2 6 5 6 2

frame 3            1 1 1 2 2 4 9 2 2 4 7 2 2 5 6

5

Yes, it is possible to just use an ordinary procedure call instruction, to call a procedure in the system space to perform system call.

The way is trying to know all the entry point of system call, that all the entry points are normally in a lookup table. By checking the table and then get the entry point to system space, an ordinary procedure call instruction can perform system call as well.