Question: Two processes P 1 and P 2 are concurrently attempting to access a single resource in a mutually exclusive manner using the semaphore operation wait

Two processes P1 and P2 are concurrently attempting to access a single resource in a mutually exclusive manner using the semaphore operation wait(). It is claimed the wait() and signal() operations on semaphores must be implemented atomically or in an indivisible fashion. What if this wait() is implemented as an ordinary function (or procedure) without being atomic?
The wait() semaphore operation can be defined as
wait(semaphore *S){
S->value--;
if (S->value <0){
add this process to S->list;
block();
}
}
Group of answer choices
There will be no impact
Both P1 and P2 could be blocked
Both P1 and P2 could be allowed to access the resource
None of the above

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!