Question: Question 3 (5 points).Locking is good strategy for synchronization during the interleaving of multiple threads. Assume the attempted implementation of a lock: void init(lock_t mutex)

Question 3 (5 points).Locking is good strategy for synchronization during the interleaving of multiple threads. Assume the attempted implementation of a lock: void init(lock_t mutex) mutex->flag 0;//0 lock is available, 1 held \} void lock(lock_t mutex) while (mutex->flag ==1 ) ; mutex->flag =1; void unlock(lock t t*mutex) \{ mutex->flag =0; Assume 5 threads are competing for this lock. How many threads can possibly hold the lo For each of the below number of threads, All Possible, B: Not Possible
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
