y = 2; parbegin x = y * 2; y = 6; parend;
up(s): wait until s < smax; then increment s by 1 down(s): wait until s > 0; then decrement s by 1Write 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 |
You can also obtain a PDF version of this. | Version of April 27, 2008 at 7:58 PM |