Question: operating system design A shared variable m, initialized to zero, is operated on by four concurrent processes A,B,Y,Z as follows. Each of the processes A
A shared variable m, initialized to zero, is operated on by four concurrent processes A,B,Y,Z as follows. Each of the processes A and B reads m from memory, increments by one, stores it to memory and then terminates. Each of the processes Y and Z reads m from memory, decrements by one, stores it to memory, and then terminates. Each process before reading m invokes the W operation (i.e. wait) on a counting semaphore S and invokes the S operation (i.e. signal) on the semaphore S.after storing m to memory. Semaphore S is initialized to two. What is the minimum possible value of m after all processes complete execution? Write the sequence of operations that result in that minimum value. (don't write the explanation in words)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
