* 1011: Added SuppressWarnings for SonarCloud errors All of these files are causing SonarCloud to report the following error: Loops should not be infinite Since these instances all require an infinite loop that will never end, these warnings should be disabled so that SonarCloud no longer reports them as error. The rule is: squid:S2189 * 1011: Made all of the randoms static and final According to SonarCloud rule: "Random" objects should be reused, randoms should not be recreated. This commit has taken all of the Randoms and made them constant variables in the files that are using them.
layout, title, folder, permalink, categories, tags
layout | title | folder | permalink | categories | tags | ||||
---|---|---|---|---|---|---|---|---|---|
pattern | Producer Consumer | producer-consumer | /patterns/producer-consumer/ | Concurrency |
|
Intent
Producer Consumer Design pattern is a classic concurrency pattern which reduces coupling between Producer and Consumer by separating Identification of work with Execution of Work.
Applicability
Use the Producer Consumer idiom when
- decouple system by separate work in two process produce and consume.
- addresses the issue of different timing require to produce work or consuming work