The producer consumer model is not a parallelization concept or scenario but a method that can be used within all different parallelization approaches. In general, this model describes that one thread, the producer, provides some data which one or several threads, the consumer(s), use(s) for further processing. A thread can be both producer and consumer, e.g., within a pipeline, which consists of several producer consumer processes in row. The communication between the producer and consumer threads is realized by message queues.
Note that the processing times are not always the same. Thus, if, e.g., a producer thread acquires images and the consumer threads process them, images can get lost if the processing threads are not ready to catch them in time. Images have to be buffered and special care has to be taken to avoid a buffer overflow. How to do that, e.g., for a pipeline, is demonstrated in section “Pipelining”.