Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 spin-lock in the acquire (sem_wait) function by blocking the calling process. But then when implementing acquire/sem_wait and release/sem_post, 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 spin-lock. Why is it OK to use the spin-lock 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 acquire/sem_wait and release/sem-post is not application specific.
B. The CS code in acquire/sem_wait and release/sem-post is executed in the kernel.
C. The CS code in acquire/sem_wait and release/sem-post is too short
D. The CS code in acquire/sem-wait and release/sem-post is more important

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions