trap |
A barrier is synchronization primitive that allows mutiple threads to reach a specific point and wait before they all can proceed. For example, threads completing a matrix computation can wait at a barrier until all threads have finished the current phase of the parallel computation, before they all can proceed to the next phase of the computation. A barrier object contains a counter which is initialized with a thread count when the barrier is created. The thread count represents the number of waiting threads that can wait in the barrier group. When each thread reaches the barrier it calls the barrier wait() method. The wait() method decrements the thread counter. When the last thread reaches the barrier and calls the wait() method, the count goes to zero. The barrier object then unblocks all the waiting threads in the barrier group to proceed.
Thread<ToolKit>
#include <ospace/thread/trap.h>
class os_trap
Throws: os_thread_toolkit_error
true if the
specified future is found and removes it from the group of futures to
manage.true if a
future is immediately available and assigns future
the available future, otherwise returns false
without blocking.Copyright©1994-2026 Recursion
Software LLC
All Rights Reserved - For use by licensed users only.