A library for working with phylogenetic and population genetic data.
v0.32.0
BlockingConcurrentQueue< T, Traits > Class Template Reference

#include <genesis/utils/threading/blocking_concurrent_queue.hpp>

Detailed Description

template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
class genesis::utils::BlockingConcurrentQueue< T, Traits >

Definition at line 82 of file blocking_concurrent_queue.hpp.

Public Member Functions

 BlockingConcurrentQueue (BlockingConcurrentQueue &&other) MOODYCAMEL_NOEXCEPT
 
 BlockingConcurrentQueue (BlockingConcurrentQueue const &) MOODYCAMEL_DELETE_FUNCTION
 
 BlockingConcurrentQueue (size_t capacity=6 *BLOCK_SIZE)
 
 BlockingConcurrentQueue (size_t minCapacity, size_t maxExplicitProducers, size_t maxImplicitProducers)
 
bool enqueue (producer_token_t const &token, T &&item)
 
bool enqueue (producer_token_t const &token, T const &item)
 
bool enqueue (T &&item)
 
bool enqueue (T const &item)
 
template<typename It >
bool enqueue_bulk (It itemFirst, size_t count)
 
template<typename It >
bool enqueue_bulk (producer_token_t const &token, It itemFirst, size_t count)
 
BlockingConcurrentQueueoperator= (BlockingConcurrentQueue &&other) MOODYCAMEL_NOEXCEPT
 
BlockingConcurrentQueueoperator= (BlockingConcurrentQueue const &) MOODYCAMEL_DELETE_FUNCTION
 
size_t size_approx () const
 
void swap (BlockingConcurrentQueue &other) MOODYCAMEL_NOEXCEPT
 
template<typename U >
bool try_dequeue (consumer_token_t &token, U &item)
 
template<typename U >
bool try_dequeue (U &item)
 
template<typename It >
size_t try_dequeue_bulk (consumer_token_t &token, It itemFirst, size_t max)
 
template<typename It >
size_t try_dequeue_bulk (It itemFirst, size_t max)
 
bool try_enqueue (producer_token_t const &token, T &&item)
 
bool try_enqueue (producer_token_t const &token, T const &item)
 
bool try_enqueue (T &&item)
 
bool try_enqueue (T const &item)
 
template<typename It >
bool try_enqueue_bulk (It itemFirst, size_t count)
 
template<typename It >
bool try_enqueue_bulk (producer_token_t const &token, It itemFirst, size_t count)
 
template<typename U >
void wait_dequeue (consumer_token_t &token, U &item)
 
template<typename U >
void wait_dequeue (U &item)
 
template<typename It >
size_t wait_dequeue_bulk (consumer_token_t &token, It itemFirst, size_t max)
 
template<typename It >
size_t wait_dequeue_bulk (It itemFirst, size_t max)
 
template<typename It , typename Rep , typename Period >
size_t wait_dequeue_bulk_timed (consumer_token_t &token, It itemFirst, size_t max, std::chrono::duration< Rep, Period > const &timeout)
 
template<typename It >
size_t wait_dequeue_bulk_timed (consumer_token_t &token, It itemFirst, size_t max, std::int64_t timeout_usecs)
 
template<typename It , typename Rep , typename Period >
size_t wait_dequeue_bulk_timed (It itemFirst, size_t max, std::chrono::duration< Rep, Period > const &timeout)
 
template<typename It >
size_t wait_dequeue_bulk_timed (It itemFirst, size_t max, std::int64_t timeout_usecs)
 
template<typename U , typename Rep , typename Period >
bool wait_dequeue_timed (consumer_token_t &token, U &item, std::chrono::duration< Rep, Period > const &timeout)
 
template<typename U >
bool wait_dequeue_timed (consumer_token_t &token, U &item, std::int64_t timeout_usecs)
 
template<typename U , typename Rep , typename Period >
bool wait_dequeue_timed (U &item, std::chrono::duration< Rep, Period > const &timeout)
 
template<typename U >
bool wait_dequeue_timed (U &item, std::int64_t timeout_usecs)
 

Static Public Member Functions

static constexpr bool is_lock_free ()
 

Public Types

typedef ConcurrentQueue::consumer_token_t consumer_token_t
 
typedef ConcurrentQueue::index_t index_t
 
typedef ConcurrentQueue::producer_token_t producer_token_t
 
typedef ConcurrentQueue::size_t size_t
 
typedef std::make_signed< size_t >::type ssize_t
 

Static Public Attributes

static const size_t BLOCK_SIZE = ConcurrentQueue::BLOCK_SIZE
 
static const size_t EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD = ConcurrentQueue::EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD
 
static const std::uint32_t EXPLICIT_CONSUMER_CONSUMPTION_QUOTA_BEFORE_ROTATE = ConcurrentQueue::EXPLICIT_CONSUMER_CONSUMPTION_QUOTA_BEFORE_ROTATE
 
static const size_t EXPLICIT_INITIAL_INDEX_SIZE = ConcurrentQueue::EXPLICIT_INITIAL_INDEX_SIZE
 
static const size_t IMPLICIT_INITIAL_INDEX_SIZE = ConcurrentQueue::IMPLICIT_INITIAL_INDEX_SIZE
 
static const size_t INITIAL_IMPLICIT_PRODUCER_HASH_SIZE = ConcurrentQueue::INITIAL_IMPLICIT_PRODUCER_HASH_SIZE
 
static const size_t MAX_SUBQUEUE_SIZE = ConcurrentQueue::MAX_SUBQUEUE_SIZE
 

Constructor & Destructor Documentation

◆ BlockingConcurrentQueue() [1/4]

BlockingConcurrentQueue ( size_t  capacity = 6 * BLOCK_SIZE)
inlineexplicit

Definition at line 113 of file blocking_concurrent_queue.hpp.

◆ BlockingConcurrentQueue() [2/4]

BlockingConcurrentQueue ( size_t  minCapacity,
size_t  maxExplicitProducers,
size_t  maxImplicitProducers 
)
inline

Definition at line 123 of file blocking_concurrent_queue.hpp.

◆ BlockingConcurrentQueue() [3/4]

◆ BlockingConcurrentQueue() [4/4]

BlockingConcurrentQueue ( BlockingConcurrentQueue< T, Traits > &&  other)
inline

Definition at line 143 of file blocking_concurrent_queue.hpp.

Member Function Documentation

◆ enqueue() [1/4]

bool enqueue ( producer_token_t const &  token,
T &&  item 
)
inline

Definition at line 222 of file blocking_concurrent_queue.hpp.

◆ enqueue() [2/4]

bool enqueue ( producer_token_t const &  token,
T const &  item 
)
inline

Definition at line 209 of file blocking_concurrent_queue.hpp.

◆ enqueue() [3/4]

bool enqueue ( T &&  item)
inline

Definition at line 196 of file blocking_concurrent_queue.hpp.

◆ enqueue() [4/4]

bool enqueue ( T const &  item)
inline

Definition at line 182 of file blocking_concurrent_queue.hpp.

◆ enqueue_bulk() [1/2]

bool enqueue_bulk ( It  itemFirst,
size_t  count 
)
inline

Definition at line 238 of file blocking_concurrent_queue.hpp.

◆ enqueue_bulk() [2/2]

bool enqueue_bulk ( producer_token_t const &  token,
It  itemFirst,
size_t  count 
)
inline

Definition at line 254 of file blocking_concurrent_queue.hpp.

◆ is_lock_free()

static constexpr bool is_lock_free ( )
inlinestaticconstexpr

Definition at line 601 of file blocking_concurrent_queue.hpp.

◆ operator=() [1/2]

BlockingConcurrentQueue& operator= ( BlockingConcurrentQueue< T, Traits > &&  other)
inline

Definition at line 149 of file blocking_concurrent_queue.hpp.

◆ operator=() [2/2]

BlockingConcurrentQueue& operator= ( BlockingConcurrentQueue< T, Traits > const &  )

◆ size_approx()

size_t size_approx ( ) const
inline

Definition at line 593 of file blocking_concurrent_queue.hpp.

◆ swap()

void swap ( BlockingConcurrentQueue< T, Traits > &  other)
inline

Definition at line 159 of file blocking_concurrent_queue.hpp.

◆ try_dequeue() [1/2]

bool try_dequeue ( consumer_token_t token,
U &  item 
)
inline

Definition at line 368 of file blocking_concurrent_queue.hpp.

◆ try_dequeue() [2/2]

bool try_dequeue ( U &  item)
inline

Definition at line 352 of file blocking_concurrent_queue.hpp.

◆ try_dequeue_bulk() [1/2]

size_t try_dequeue_bulk ( consumer_token_t token,
It  itemFirst,
size_t  max 
)
inline

Definition at line 401 of file blocking_concurrent_queue.hpp.

◆ try_dequeue_bulk() [2/2]

size_t try_dequeue_bulk ( It  itemFirst,
size_t  max 
)
inline

Definition at line 385 of file blocking_concurrent_queue.hpp.

◆ try_enqueue() [1/4]

bool try_enqueue ( producer_token_t const &  token,
T &&  item 
)
inline

Definition at line 306 of file blocking_concurrent_queue.hpp.

◆ try_enqueue() [2/4]

bool try_enqueue ( producer_token_t const &  token,
T const &  item 
)
inline

Definition at line 294 of file blocking_concurrent_queue.hpp.

◆ try_enqueue() [3/4]

bool try_enqueue ( T &&  item)
inline

Definition at line 282 of file blocking_concurrent_queue.hpp.

◆ try_enqueue() [4/4]

bool try_enqueue ( T const &  item)
inline

Definition at line 268 of file blocking_concurrent_queue.hpp.

◆ try_enqueue_bulk() [1/2]

bool try_enqueue_bulk ( It  itemFirst,
size_t  count 
)
inline

Definition at line 323 of file blocking_concurrent_queue.hpp.

◆ try_enqueue_bulk() [2/2]

bool try_enqueue_bulk ( producer_token_t const &  token,
It  itemFirst,
size_t  count 
)
inline

Definition at line 338 of file blocking_concurrent_queue.hpp.

◆ wait_dequeue() [1/2]

void wait_dequeue ( consumer_token_t token,
U &  item 
)
inline

Definition at line 458 of file blocking_concurrent_queue.hpp.

◆ wait_dequeue() [2/2]

void wait_dequeue ( U &  item)
inline

Definition at line 415 of file blocking_concurrent_queue.hpp.

◆ wait_dequeue_bulk() [1/2]

size_t wait_dequeue_bulk ( consumer_token_t token,
It  itemFirst,
size_t  max 
)
inline

Definition at line 548 of file blocking_concurrent_queue.hpp.

◆ wait_dequeue_bulk() [2/2]

size_t wait_dequeue_bulk ( It  itemFirst,
size_t  max 
)
inline

Definition at line 503 of file blocking_concurrent_queue.hpp.

◆ wait_dequeue_bulk_timed() [1/4]

size_t wait_dequeue_bulk_timed ( consumer_token_t token,
It  itemFirst,
size_t  max,
std::chrono::duration< Rep, Period > const &  timeout 
)
inline

Definition at line 582 of file blocking_concurrent_queue.hpp.

◆ wait_dequeue_bulk_timed() [2/4]

size_t wait_dequeue_bulk_timed ( consumer_token_t token,
It  itemFirst,
size_t  max,
std::int64_t  timeout_usecs 
)
inline

Definition at line 566 of file blocking_concurrent_queue.hpp.

◆ wait_dequeue_bulk_timed() [3/4]

size_t wait_dequeue_bulk_timed ( It  itemFirst,
size_t  max,
std::chrono::duration< Rep, Period > const &  timeout 
)
inline

Definition at line 537 of file blocking_concurrent_queue.hpp.

◆ wait_dequeue_bulk_timed() [4/4]

size_t wait_dequeue_bulk_timed ( It  itemFirst,
size_t  max,
std::int64_t  timeout_usecs 
)
inline

Definition at line 521 of file blocking_concurrent_queue.hpp.

◆ wait_dequeue_timed() [1/4]

bool wait_dequeue_timed ( consumer_token_t token,
U &  item,
std::chrono::duration< Rep, Period > const &  timeout 
)
inline

Definition at line 492 of file blocking_concurrent_queue.hpp.

◆ wait_dequeue_timed() [2/4]

bool wait_dequeue_timed ( consumer_token_t token,
U &  item,
std::int64_t  timeout_usecs 
)
inline

Definition at line 476 of file blocking_concurrent_queue.hpp.

◆ wait_dequeue_timed() [3/4]

bool wait_dequeue_timed ( U &  item,
std::chrono::duration< Rep, Period > const &  timeout 
)
inline

Definition at line 449 of file blocking_concurrent_queue.hpp.

◆ wait_dequeue_timed() [4/4]

bool wait_dequeue_timed ( U &  item,
std::int64_t  timeout_usecs 
)
inline

Definition at line 433 of file blocking_concurrent_queue.hpp.

Member Typedef Documentation

◆ consumer_token_t

◆ index_t

◆ producer_token_t

◆ size_t

Definition at line 91 of file blocking_concurrent_queue.hpp.

◆ ssize_t

typedef std::make_signed<size_t>::type ssize_t

Definition at line 92 of file blocking_concurrent_queue.hpp.

Member Data Documentation

◆ BLOCK_SIZE

const size_t BLOCK_SIZE = ConcurrentQueue::BLOCK_SIZE
static

Definition at line 94 of file blocking_concurrent_queue.hpp.

◆ EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD

const size_t EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD = ConcurrentQueue::EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD
static

Definition at line 95 of file blocking_concurrent_queue.hpp.

◆ EXPLICIT_CONSUMER_CONSUMPTION_QUOTA_BEFORE_ROTATE

const std::uint32_t EXPLICIT_CONSUMER_CONSUMPTION_QUOTA_BEFORE_ROTATE = ConcurrentQueue::EXPLICIT_CONSUMER_CONSUMPTION_QUOTA_BEFORE_ROTATE
static

Definition at line 99 of file blocking_concurrent_queue.hpp.

◆ EXPLICIT_INITIAL_INDEX_SIZE

const size_t EXPLICIT_INITIAL_INDEX_SIZE = ConcurrentQueue::EXPLICIT_INITIAL_INDEX_SIZE
static

Definition at line 96 of file blocking_concurrent_queue.hpp.

◆ IMPLICIT_INITIAL_INDEX_SIZE

const size_t IMPLICIT_INITIAL_INDEX_SIZE = ConcurrentQueue::IMPLICIT_INITIAL_INDEX_SIZE
static

Definition at line 97 of file blocking_concurrent_queue.hpp.

◆ INITIAL_IMPLICIT_PRODUCER_HASH_SIZE

const size_t INITIAL_IMPLICIT_PRODUCER_HASH_SIZE = ConcurrentQueue::INITIAL_IMPLICIT_PRODUCER_HASH_SIZE
static

Definition at line 98 of file blocking_concurrent_queue.hpp.

◆ MAX_SUBQUEUE_SIZE

const size_t MAX_SUBQUEUE_SIZE = ConcurrentQueue::MAX_SUBQUEUE_SIZE
static

Definition at line 100 of file blocking_concurrent_queue.hpp.


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