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

#include <work_stealing_deque.hpp>

Public Member Functions

 work_stealing_deque (size_t capacity=default_capacity)
auto push (T &&item) -> bool
template<typename U = T, std::enable_if_t< std::is_copy_constructible_v< U >, int > = 0>
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
void clear ()
auto clear_and_count () -> size_t

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::detail::work_stealing_deque< T >

Definition at line 18 of file work_stealing_deque.hpp.

Constructor & Destructor Documentation

◆ work_stealing_deque()

template<typename T>
threadschedule::detail::work_stealing_deque< T >::work_stealing_deque ( size_t capacity = default_capacity)
inlineexplicit

Definition at line 43 of file work_stealing_deque.hpp.

References default_capacity.

Member Function Documentation

◆ clear()

template<typename T>
void threadschedule::detail::work_stealing_deque< T >::clear ( )
inline

Definition at line 117 of file work_stealing_deque.hpp.

References clear_and_count().

◆ clear_and_count()

template<typename T>
auto threadschedule::detail::work_stealing_deque< T >::clear_and_count ( ) ->size_t
inlinenodiscard

Definition at line 123 of file work_stealing_deque.hpp.

References steal().

Referenced by clear().

◆ empty()

template<typename T>
auto threadschedule::detail::work_stealing_deque< T >::empty ( ) const->bool
inlinenodiscard

Definition at line 111 of file work_stealing_deque.hpp.

References size().

◆ pop()

template<typename T>
auto threadschedule::detail::work_stealing_deque< T >::pop ( T & item) ->bool
inlinenodiscard

Definition at line 76 of file work_stealing_deque.hpp.

◆ push() [1/2]

template<typename T>
auto threadschedule::detail::work_stealing_deque< T >::push ( T && item) ->bool
inlinenodiscard

Definition at line 49 of file work_stealing_deque.hpp.

◆ push() [2/2]

template<typename T>
template<typename U = T, std::enable_if_t< std::is_copy_constructible_v< U >, int > = 0>
auto threadschedule::detail::work_stealing_deque< T >::push ( T const & item) ->bool
inlinenodiscard

Definition at line 63 of file work_stealing_deque.hpp.

◆ size()

template<typename T>
auto threadschedule::detail::work_stealing_deque< T >::size ( ) const->size_t
inlinenodiscard

Definition at line 103 of file work_stealing_deque.hpp.

Referenced by empty().

◆ steal()

template<typename T>
auto threadschedule::detail::work_stealing_deque< T >::steal ( T & item) ->bool
inlinenodiscard

Definition at line 90 of file work_stealing_deque.hpp.

Referenced by clear_and_count().

Member Data Documentation

◆ cache_line_size

template<typename T>
size_t threadschedule::detail::work_stealing_deque< T >::cache_line_size = 64
staticconstexpr

Definition at line 21 of file work_stealing_deque.hpp.

◆ default_capacity


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