class streaming.base.shared.SharedBarrier(filelock_path, shm_name)[source]#

A barrier that works inter-process using a filelock and shared memory.

We set the number of processes (and thereby initialize num_exit) on the first time this object is called. This is because the object is created in a per-rank process, and called by worker processes.

  • filelock_path (str) – Path to lock file on local filesystem.

  • shm_name (str) – Shared memory object name in /dev/shm.

property flag#

Get property flag.


bool – The flag value.

property num_enter#

Get property num_enter.


int – Number of processes that have entered the barrier.

property num_exit#

Get property num_exit.


int – Number of processes that have exited the barrier.