33#include <NDEVR/BaseValues.h>
66 static void wait(
void*
object, std::unique_lock<std::mutex>& lock);
73 static void wait(
void*
object,
uint08 time, std::unique_lock<std::mutex>& lock);
90 template<
class t_type,
class t_function_type>
103 template<
class t_type,
class t_function_type>
108 if (len < grain_size)
110 std::sort(data, data + len, function);
122 std::inplace_merge(data, data + len / 2, data + len, function);
Contains thread-safe operations for inter-thread logic Increment and Decrement can be used to safely ...
static void wait(void *object, std::unique_lock< std::mutex > &lock)
Blocks the calling thread until notified on the given object.
static void ParallelGrainSort(t_type *data, uint04 len, uint04 grain_size, const t_function_type &function)
Recursively sorts an array in parallel, splitting work into async tasks when the array exceeds the gr...
static uint04 decrement(volatile uint04 &value)
Atomically decrements a shared value by one.
static void notifyAll(void *object)
Wakes all threads waiting on the given object.
static void wait(void *object, uint08 time, std::unique_lock< std::mutex > &lock)
Blocks the calling thread until notified or until the timeout elapses.
static void ParallelSort(t_type *data, uint04 len, t_function_type function)
Sorts an array in parallel using a default grain size.
static void notify(void *object)
Wakes one thread waiting on the given object.
static uint04 increment(volatile uint04 &value)
Atomically increments a shared value by one.
The primary namespace for the NDEVR SDK.
constexpr t_type getMax(const t_type &left, const t_type &right)
Finds the max of the given arguments using the > operator The only requirement is that t_type have > ...
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...