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 

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!