Producer-Consumer


The following is an example of the producer-consumer pattern. The main thread (producer) places values into a bounded buffer (a circular queue), while worker threads (the consumers) remove values from this buffer and perform a computation.

The complete source code is available as a zip file.

prodcon.c