Help With these please!
** EXERCISE 4.3.1: Implementation of general semaphores.
?
In the implementation of general semaphores, some of the Vb operations are executed only conditionally. Label the Pb and Vb operations as shown below and determine which Pb/Vb pair is executed in each of the three cases:
P(s){ Pb1: Pb(ms) 5=5-1 if(s<0 Vb1: Vb(ms) block self on s Vb2: Vb(ms)
V(s}{ Pb2: Pb(ms) s=5+1 if (s<=0) reactivate a process else Vb3: Vb(ms)
(a)P(s) is executed when s > 0
(b)V(s) is executed when s>=0
(c)P(s) is executed when s <=0,followed by a V(s
Feedback?