Question: For mutexs and semaphores, we acquired resources in a blocking manner with wait(). Why don't we add a new function to check for resource availability

For mutexs and semaphores, we acquired resources in a blocking manner with wait(). Why don't we add a new function to check for resource availability and lock it in one atomic step (i.e., a non-blocking function that immediately either locks the resource and returns true or fails to lock and returns false), instead of adding an OS-level method for handling deadlocks.

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!