Here is a solution to some of the questions of MP3 6.2 === Most of you have got this correct.The solution lies in the manner in which the new process is assigned it's number ( via the max algorithm ) 6.7 === This solution is from the Tannenbaum textbook. #define CHAIRS 5 typedef int semaphore; semaphore customers=0; semaphore barber=0; semaphore mutex=1; //For mutual exclusion semaphore waiting=0; void Barber(void) { while(true) { wait(customer); // Go to sleep if customer=0 wait(mutex); // Acquire access to waiting waiting=waiting-1; signal(barber); //Barber is ready signal(mutex); //Release waiting cut_hair(); } } void Customer(void) { wait(mutex); if(waiting One of the processes must give up resources voluntarily so that the others can complete. b> A scenario in which we can assume that the processes will not use resources equivalent to their maximum needs. 7.10 ==== Everyone got this correct. 7.13 ==== a> The need matrix is Max-Availability A B C D P0 0 0 0 0 P1 0 7 5 0 P2 1 0 0 2 P3 0 0 2 0 P4 0 6 4 2 b> The system is in a safe state since the safe sequence P0-P2-P1-P3-P4 exists.The procedure for finding out the safe state is outlined in the worked examples in the textbook. c> Using similar logic as in the above we find that the request can be granted immediatly since we can obtain a safe sequence after granting the request. 7.14 ==== a> Deadlock cannot occur due to resource pre-emption b> Indefinite blocking can occur if a process is pre-empted of its resources regularly. NOTE ==== If you still have some doubts , you can clear them by meeting me during my TA hours on Wednesday.