PFUNC 1.0
|
#include <pfunc/barrier.hpp>
Public Member Functions | |
barrier () | |
void | initialize (const unsigned int &size) |
void | operator() () |
Public Attributes | |
ALIGN64 unsigned | barrier_size |
ALIGN64 unsigned | barrier_phase |
ALIGN64 unsigned | barrier_count |
pfunc::detail::barrier::barrier | ( | ) | [inline] |
Number of threads currently in barrier
void pfunc::detail::barrier::initialize | ( | const unsigned int & | size | ) | [inline] |
[in] | size | The number of threads in the barrier. |
void pfunc::detail::barrier::operator() | ( | void | ) | [inline] |
Execute the barrier.
This is the last thread. Reset barrier_size and toggle the phase.
This is NOT the last thread--wait for the phase to change
Try to spin for a while first
Give up and sleep
ALIGN64 unsigned pfunc::detail::barrier::barrier_count |
Phase -- toggles so that we ensure correctness
ALIGN64 unsigned pfunc::detail::barrier::barrier_phase |
Number of threads in the barrier
ALIGN64 unsigned pfunc::detail::barrier::barrier_size |