X. Mutual exclusion hold & wait no preemption cycle in resource request graph 4. examHandout = new Semaphore(); examHandin = new Semaphore(); studentReady = new Semaphore(); testStart = new Condition(lock); testStop = new Condition(lock); Student() { examHandout.P(); println("writing name"); studentReady.V(); testStart.sleep(); println("taking test"); testStop.sleep(); examHandin.V(); } TA() { repeat 50 { examHandout.V(); } } Professor() { repeat 100 { studentReady.P(); } testStart.wakeAll(); waitUntil(90*60); testStop.wakeAll(); repeat 100 { examHandin.P(); }