y = 2; parbegin x = y * 2; y = 6; parend;
signal(s): wait until s < SMAX; then increment s by 1
wait(s): wait until s > 0; then decrement s by 1
Write a monitor to implement bounded semaphores. (Hint: assume the semaphore is to be initialized to the constant SINIT and the maximum value is SMAX.)
name | arrival time | service time |
---|---|---|
A | 0 | 3 |
B | 2 | 5 |
C | 4 | 2 |
D | 6 | 1 |
E | 8 | 4 |
|
ECS 150, Operating Systems Version of April 20, 2022 at 7:47PM
|
You can also obtain a PDF version of this. |