Question: The following ( code in C ) provides an example of a race condition, if it were executed by two processes roughly at the same

The following (code in C) provides an example of a race condition, if it were executed by two processes roughly at the same time. Explain- whatever bug could arise for the race condition. Solve the bug using Mutex/Bi
int queue[SIZE], i =0; //assume these are shared between processes void insert(int x)
{
queue[i]= x;
i++;
}
Atomic wait and signal do not violate the mutual exclusion. Explain the reasons?

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!