Question: Based on what you studied in this chapter, explain how to change the code fragment in Figure so that deadlock cannotoccur. shared boolean lockl =
Based on what you studied in this chapter, explain how to change the code fragment in Figure so that deadlock cannotoccur.

shared boolean lockl = FALSE; /* Shared variables */ shared boolean lock2 = FALSE; shared list L; Program for p, Program for p. /* Enter crit section to /* Enter crit section to * delete elt from list */ enter (lockl); ; /* Exit critical section */ exit(lock1); ; /* Enter crit section to * update length */ enter (lock2); ; /* Exit critical section */ exit(lock2); * update length / enter (lock2); ; /* Exit critical section */ exit(lock2); ; /* Enter crit section to * add elt to list */ enter (lockl); ; /* Exit critical section */ exit (lockl);
Step by Step Solution
3.43 Rating (169 Votes )
There are 3 Steps involved in it
This deadlock can be prevented by forcing all processes ... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
34-E-CE-OS (482).docx
120 KBs Word File
