April 2018
Intermediate to advanced
300 pages
7h 41m
English
One of the best patterns to execute long-running operations is the producer/consumer pattern. In this pattern, there are producers and consumers, and one or more producers are connected to one or more consumers through a shared data structure known as BlockingCollection. BlockingCollection is a fixed-sized collection used in parallel programming. If the collection is full, the producers are blocked, and if the collection is empty, no more consumers should be added:

In a real-world example, the producer could be a component reading images from a database and the consumer could be a component that processes that image ...
Read now
Unlock full access