Question
Synchronization: Consider the following generalization of semaphores, PVblock. Like semaphores, after creation/initialization, PVblock semaphores have only two operations, Up and Down. However, both primitives take
Synchronization: Consider the following generalization of semaphores, PVblock. Like semaphores, after creation/initialization, PVblock semaphores have only two operations, Up and Down. However, both primitives take two parameters: the semaphore name (like regular semaphores) and a positive integer value (count). Down(S,count) is like Down(S) on a regular semaphore S, except that S must have a stored value no less than count or else the caller is blocked.
a) Sketch the code necessary to implement Up(S, count) and Down(S, count). You may assume basic data structures such a queues.
b) Under what circumstances can a process remain blocked even when the value associated with a semaphore is positive? Explain.
c) Explain the policy issues that can arise from performing Up() on S when there are multiple processes blocked on S. Describe two distinct policies and explain how they can be implemented, and what the consequences of each may be.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started