Question: When discussing semaphores first, we tried to avoid the spin - lock in the acquire ( sem _ wait ) function by blocking the calling
When discussing semaphores first, we tried to avoid the spinlock in the acquire semwait function by blocking the calling process. But then when implementing acquiresemwait and releasesempost, the operations on the shared variable within the these functions become the critical section and we said that they can now be protected using a spinlock. Why is it OK to use the spinlock when implementing semaphore operations while we were trying to avoid in the first place when discussing in the context of applications?
A The CS code in acquiresemwait and releasesempost is not application specific.
B The CS code in acquiresemwait and releasesempost is executed in the kernel.
C The CS code in acquiresemwait and releasesempost is too short
D The CS code in acquiresemwait and releasesempost is more important
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
