4.4. Barrier Synchronization

Barriers are a common and simple space-based technique used to synchronize a group of processes. A barrier is a particular point in a distributed computation that every process in a group must reach before any process can proceed further. For instance, a distributed application may start many “worker” processes and have them wait until some initial conditions hold before they are allowed to start processing. Some distributed computations may also proceed in phases, where all processes need to complete phase one before proceeding as a group to phase two.

Barriers are easy to implement with a shared variable: If we have n processes that need to reach a certain point in the computation before any processes can continue, ...

Get JavaSpaces™ Principles, Patterns, and Practice now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.