Question: Question 2 : ( 5 Marks ) CO 2 The following ( code in C ) provides an example of a race condition, if it
Question :
Marks
CO 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 MutexBinary Semaphore stating
the differences between MUTEX and Binary Semaphore
int queueSIZE i;assume these are shared between processes
void insertint x
queuei 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
