Question: Two concurrent processes share a data item sum, which is initialized to 0 . However, they do not use mutual exclusion while accessing its value,

Two concurrent processes share a data item sum, which is initialized to 0.However, they do not use mutual exclusion while accessing its value, which means that we have a race condition here. Each
process contains a loop that executes 50 times and contains the single statement sum =sum+1(notice that this statement means three machine instructions. One: to read value of variable sum from memory, two: andd 1 to that value, three: store the result back into memory). If no other operations are performed on sum, indicate the lower bound and upper bound on the value of sum when both processes terminate.Two concurrent processes share a data item sum, which is initialized to 0.However, they do not use mutual exclusion while accessing its value, which means that we have a race condition here. Each
process contains a loop that executes 50 times and contains the single statement sum =sum+1(notice that this statement means three machine instructions. One: to read value of variable sum from memory, two: andd 1 to that value, three: store the result back into memory). If no other operations are performed on sum, indicate the lower bound and upper bound on the value of sum when both processes terminate.

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 Databases Questions!