There are certain situation in which a syncronization of
all processes (or a subset of them) is desired.
Typical examples in a HEP experiment are: start a run
(but only if all the processes are ready, in particular
all the processes that write the data to storage medium),
end a run, or distribute a given event to a subset of processes
bypassing the fifo system (e.g end of spill signal if the
data acquisition has a spill structure).
A set of routines allow to wait until all processes have
finished processing the events and are sleeping on semaphores
or to wake up processes
that are sleeping on a semaphore. In the E787 experiment these routines are
used by the main user interface at the beginning and end of
a run.
In addition a broadcast mechanism has been developped in order to
distribute (broadcast) events. Every process that attaches to the
DD system specifies whether he wants to participate in this
broadcast mechanism. Two modes are possible: In the first one
(SIGNAL mode) the process receives a signal upon which
he reads a special fifo, where he finds the broadcast message.
This mode is relativly CPU intensive, as a large number of
processes can suddenly compete for access to that broadcast
fifo. Therefore another mode (USMAIL) has been added in which
the broadcast message is simply added into the process's fifo.
In this (less reliable) mode the message can be lost if several
processes are reading from the same fifo.
E.g. this broadcast mechanism is used in the E787 experiment
to distribute the scaler record at the end of every spill
to all the processes.