32using std::atomic_uint;
33using std::this_thread::sleep_for;
34using namespace std::chrono_literals;
42 const uint NUM_THREADS = 256;
66 localSum = ran.i(1000);
67 stage1.fetch_add (localSum);
72 localSum += ran.i(1000);
73 stage2.fetch_add (localSum+sync);
114 array<TestThread,NUM_THREADS> threads;
117 CHECK (
explore(threads).and_all());
122 CHECK (NUM_THREADS == finish);
124 CHECK (stage1 < stage2);
125 CHECK (stage2 > sumLocals(threads));
126 CHECK (stage2 == sumLocals(threads) + NUM_THREADS*stage1);
A one time N-fold mutual synchronisation barrier.
A thin convenience wrapper to simplify thread-handling.
A test thread to perform a summation protocol including synchronisation points.
Abstract Base Class for all testcases.
Building tree expanding and backtracking evaluations within hierarchical scopes.
uint sumLocals(CON const &threads)
sum up all localSum fields from all TestThread instances in a container
Implementation namespace for support and library code.
SeedNucleus & seedFromDefaultGen()
draw seed another Generator from the default RandomSequencer
auto explore(IT &&srcSeq)
start building a IterExplorer by suitably wrapping the given iterable source.
Test runner and basic definitions for tests.
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
A N-fold synchronisation latch using yield-wait until fulfilment.
Convenience front-end to simplify and codify basic thread handling.