| |||||
| |||||
Description | |||||
A module containing barriers. A barrier is a synchronisation primitive. When N processes are enrolled on a barrier, all N must synchronise on the barrier before any synchronisations may complete, at which point they all complete. That is, when a single process synchronises on a barrier, it must then wait until all the other enrolled processes also synchronise before it can finish. Only processes enrolled on a barrier may synchronise on it. Enrolled barriers should not be passed around between processes, or used twice in a parallel composition. Instead, each process should enroll on the barrier itself. Barriers support choice (alting). This can lead to a lot of non-determinism and some confusion. Consider these two processes, both enrolled on barriers a and b: (sync a <-> sync b) (sync b <-> sync a) Which barrier completes is determined by the run-time, and will be an arbitrary choice. This is even the case when priority is involved: (sync a </> sync b) (sync b </> sync a) Clearly there is no way to resolve this to satisfy both priorities; the run-time will end up choosing. Barrier poison can be detected when syncing, enrolling or resigning. You may only poison a barrier that you are currently enrolled on. Barriers can also support phases. The idea behind a phased barrier is that a barrier is always on a certain phase P. Whenever a barrier successfully completes, the phase is incremented (but it does not have to be an integer). Everyone is told the new phase once they complete a synchronisation, and may query the current phase for any barrier that they are currently enrolled on. | |||||
Synopsis | |||||
Documentation | |||||
| |||||
A special case of the PhasedBarrier that has no useful phases, i.e. a standard barrier. | |||||
| |||||
A useful type synonym for enrolled barriers with no phases Added in 1.1.0 | |||||
| |||||
Creates a new barrier with no processes enrolled | |||||
| |||||
Creates a new barrier with no processes enrolled and labels it in traces using the given label. See newBarrier. | |||||
| |||||
| |||||
| |||||
Creates a new barrier with no processes enrolled, that will be on the given phase. You will often want to pass in the last value in your phase cycle, so that the first synchronisation moves it on to the first The Show constraint was added in version 1.5.0 | |||||
| |||||
Creates a new barrier with no processes enrolled and labels it in traces using the given label. See newPhasedBarrier. The Show constraint was added in version 1.5.0. | |||||
| |||||
Creates a new barrier with no processes enrolled, that will be on the given phase, along with a custom function to increment the phase. You can therefore use this function with Integer as the inner type (and succ or (+1) as the incrementing function) to get a barrier that never cycles. You can also do things like supplying (+2) as the incrementing function, or even using lists as the phase type to do crazy things. Note that the phase will not show up in the traces -- see newPhasedBarrierCustomShowInc for that. | |||||
| |||||
Creates a new barrier with no processes enrolled, that will be on the given phase, along with a custom function to show the phase in traces and to increment the phase. You can therefore use this function with Integer as the inner type (and succ or (+1) as the incrementing function, and show as the showing function) to get a barrier that never cycles. You can also do things like supplying (+2) as the incrementing function, or even using lists as the phase type to do crazy things. This function was added in version 1.5.0. | |||||
| |||||
Creates a new barrier with no processes enrolled and labels it in traces using the given label. See newPhasedBarrierCustomInc. Note that the barrier will not record the phase in the traces -- see newPhasedBarrierWithLabelCustomShowInc for that. | |||||
| |||||
Creates a new barrier with no processes enrolled and labels it in traces using the given label and given show function for the phase. See newPhasedBarrierWithLabelCustomInc. This function was added in version 1.5.0. | |||||
| |||||
Finds out the current phase a barrier is on. | |||||
| |||||
If the barrier is not in the given phase, synchronises on the barrier repeatedly until it is in the given phase. | |||||
| |||||
Synchronises on the given barrier. You must be enrolled on a barrier in order to synchronise on it. Returns the new phase, following the synchronisation. | |||||
| |||||
Gets the identifier of a Barrier. Useful if you want to identify it in the trace later on. | |||||
Produced by Haddock version 2.4.2 |