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, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access