Question: In the following code example, A . Does a deadlock guaranteed to occur every time? Answer Y or N . B . Is this an
In the following code example,
A Does a deadlock guaranteed to occur every time? Answer Y or N
B Is this an example of a circular wait? Answer Y or N
C Is there a cycle in the resourceallocation graph for the following program? Answer Y or N
D Which line is violating the ordering, thus creating the possibility of a deadlock? Enter the line number.
E The program will be deadlockfree if line and line
thread one runs in this function
void do work onevoid param
pthread mutex lock&first mutex;
pthread mutex lock&second mutex;
Do some work
pthread mutex unlock&second mutex;
pthread mutex unlock&first mutex;
pthread exit;
thread two runs in this function
void do work twovoid param
pthread mutex lock&second mutex;
pthread mutex lock&first mutex;
Do some work
pthread mutex unlock&first mutex;
pthread mutex unlock&second mutex;
pthread exit;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
