|
|
|
|
|
|
|
|
|
|
|
|
|
n |
Monitor needs
to hold the buffer:
|
|
|
|
u |
buffer:
array[0..k-1] of items;
|
|
|
n |
needs two
condition variables:
|
|
|
|
u |
notfull: true
when buffer is not full
|
|
|
|
u |
notemty: true
when buffer is not empty
|
|
|
n |
needs buffer
pointers and counts:
|
|
|
|
u |
nextin: points
to next item to be appended
|
|
|
u |
nextout: points
to next item to be taken
|
|
|
|
u |
count: holds the
number of items in buffer
|
|