local variable next produced in which the new item to be produced is stored.
The consumer process has a local variable next consumed in which the item
to be consumed is stored.
This scheme allows at most BUFFER SIZE − 1 items in the buffer at the
same time. We leave it as an exercise for you to provide a solution in which
BUFFER SIZE items can be in the buffer at the same time. In Section 3.5.1, we
illustrate the POSIX API for shared memory.