ThreadSchedule 1.0.0
Modern C++ thread management library
Loading...
Searching...
No Matches
threadschedule::WorkStealingDeque< T > Class Template Reference

High-performance work-stealing deque for individual worker threads. More...

#include <thread_pool.hpp>

Public Member Functions

 WorkStealingDeque (size_t capacity=DEFAULT_CAPACITY)
auto push (T &&item) -> bool
auto push (T const &item) -> bool
auto pop (T &item) -> bool
auto steal (T &item) -> bool
auto size () const -> size_t
auto empty () const -> bool

Static Public Attributes

static constexpr size_t CACHE_LINE_SIZE = 64
static constexpr size_t DEFAULT_CAPACITY = 1024

Detailed Description

template<typename T>
class threadschedule::WorkStealingDeque< T >

High-performance work-stealing deque for individual worker threads.

Definition at line 23 of file thread_pool.hpp.

Constructor & Destructor Documentation

◆ WorkStealingDeque()

template<typename T>
threadschedule::WorkStealingDeque< T >::WorkStealingDeque ( size_t capacity = DEFAULT_CAPACITY)
inlineexplicit

Definition at line 50 of file thread_pool.hpp.

Member Function Documentation

◆ empty()

template<typename T>
auto threadschedule::WorkStealingDeque< T >::empty ( ) const -> bool
inline

Definition at line 129 of file thread_pool.hpp.

◆ pop()

template<typename T>
auto threadschedule::WorkStealingDeque< T >::pop ( T & item) -> bool
inline

Definition at line 88 of file thread_pool.hpp.

◆ push() [1/2]

template<typename T>
auto threadschedule::WorkStealingDeque< T >::push ( T && item) -> bool
inline

Definition at line 56 of file thread_pool.hpp.

◆ push() [2/2]

template<typename T>
auto threadschedule::WorkStealingDeque< T >::push ( T const & item) -> bool
inline

Definition at line 72 of file thread_pool.hpp.

◆ size()

template<typename T>
auto threadschedule::WorkStealingDeque< T >::size ( ) const -> size_t
inline

Definition at line 122 of file thread_pool.hpp.

◆ steal()

template<typename T>
auto threadschedule::WorkStealingDeque< T >::steal ( T & item) -> bool
inline

Definition at line 106 of file thread_pool.hpp.

Member Data Documentation

◆ CACHE_LINE_SIZE

template<typename T>
size_t threadschedule::WorkStealingDeque< T >::CACHE_LINE_SIZE = 64
staticconstexpr

Definition at line 26 of file thread_pool.hpp.

◆ DEFAULT_CAPACITY

template<typename T>
size_t threadschedule::WorkStealingDeque< T >::DEFAULT_CAPACITY = 1024
staticconstexpr

Definition at line 27 of file thread_pool.hpp.


The documentation for this class was generated from the following file: