|Portability||non-portable (requires Futures)|
This module implements barrier using futures. A rendezvous ensures that two threads meet at a specific point before continuing their computation. The rendezvous idiom blocks at this point until both threads have arrived. A barrier is a rendezvous for a group of processes. Assume that a application is divided into phases where a couple of threads compute several interims to be the input for the next phase. Then all threads must complete the current phase before entering the next. To achieve this behaviour a barrier is placed at the end of a phase. Note that a barriers is purely for synchronisation and not for exchange of data.
Warning: All operations on barrier should only be used within the global wrapper function
A new barrier type contains of a buffer containing the count of active threads, a buffer containing the a count of finished threads and a capacity.