Master Slave Pattern

Partitioning work into semantically identical sub-tasks using the 'Divide and conquer' principle. Work is partitioned into several equal sub-tasks that are processed independently. The result of the whole calculation is computed from the results provided by each partial process.

A master component:

  • Divides work into equal sub-tasks (thread, process, etc)
  • Delegates these sub-tasks to several independent but semantically-identical slave components
  • Introduces a coordination instance between clients of the service and the processing of individual sub-tasks
  • Computes a final result from the partial results the slaves return
  • Provide all slaves with a common interface. Lets clients of the overall service communicate only with the master.

The Master-Slave design pattern supports fault tolerance, parallel computation and computational accuracy(computation is delegated to several different implementations; inaccurate results can be detected and handled). A master component distributes work to identical slave components and computes the results these slaves return.

Related Patterns:
Chain of Responsibility, Command and Mediator.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License