/producer_consumer_problem

A producer consumer simulator

Primary LanguageJavaMIT LicenseMIT

Producer_consumer_problem

It is a simple producer consumer problem simulator, implemented with multiple threads.

Each thread in the program representing either producer/consumer-producer(CP)/consumer. The first producer will produce intermediate product and give to consumer producer. Consumer producer will use the intermediate product it received to produce final product and pass to consumer. Once consumer receives the final product, this loop will end and start a new loop.

Here is a image shows how it works:

Image of producer consumer simulator