Question: The code is rewritten as follows, to make the lock more fine grained by moving the other stuff out of the critical section. Suppose
The code is rewritten as follows, to make the lock more "fine grained" by moving the "other stuff" out of the critical section. Suppose that f and g are only changed in the code shown. // Thread 1 lock (m); f=&g; printf("%d, ", *); unlock (m); // do some other stuff lock (m); printf("%d ", *f); unlock (m); What are all the possible outputs of the system now? // Thread 2 lock (m); f = NULL; g= 11; unlock (m);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
