January 2020
Intermediate to advanced
640 pages
16h 56m
English
Now, let's take a look at the other half of the barrier implementation logic that runs on the master node. The masterStepBarrier type, the definition of which is given as follows, is admittedly more interesting as it contains the actual barrier synchronization logic:
type masterStepBarrier struct { ctx context.Context numWorkers int waitCh map[proto.Step_Type]chan *proto.Step notifyCh map[proto.Step_Type]chan *proto.Step}One key difference is that the masterStepBarrier type defines two types of channels: