
上QQ阅读APP看书,第一时间看更新
The master-slave pattern
The master-slave pattern is applied for designing a system if the system involves similar or identical computations that need to be performed repeatedly with separate set of inputs and context. The master-slave pattern offers support for fault tolerance and parallel computation.
The master-slave pattern is depicted in the following diagram:
The master component distributes the work among all the slave components and calculates the final result by summing up the results that are returned by each slave. The master-slave pattern is used for architecting embedded systems and used in the design of systems that perform massive parallel computations. The following is a sequence diagram of the master-slave pattern: