* 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 | Master-Worker | master-worker-pattern | /patterns/master-worker-pattern/ | Centralised Parallel Processing |
|
Also known as
Master-slave or Map-reduce
Intent
Used for centralised parallel processing.
Applicability
This pattern can be used when data can be divided into multiple parts, all of which need to go through the same computation to give a result, which need to be aggregated to get the final result.
Explanation
In this pattern, parallel processing is performed using a system consisting of a master and some number of workers, where a master divides the work among the workers, gets the result back from them and assimilates all the results to give final result. The only communication is between the master and the worker - none of the workers communicate among one another and the user only communicates with the master to get the required job done. The master has to maintain a record of how the divided data has been distributed, how many workers have finished their work and returned a result, and the results themselves to be able to aggregate the data correctly.