a relaxed PRIORITY QUEUE shared by threads: \( n \) queues under locks, the pop from the better of two, each queue an H behind two buffers
More...
|
| | MultiQueue (std::size_t n, unsigned s=16, std::uint64_t seed=1, Less less=Less()) |
| | the structure of \( n \) empty queues, kept by a thread for \( s \) operations, with the draws from the seed seed; \( n = 2 p \) for \( p \) threads, \( n = 1 \) an exact queue
|
| | MultiQueue (const MultiQueue &)=delete |
| | no copy, since the threads share it by its address
|
| MultiQueue & | operator= (const MultiQueue &)=delete |
| | no copy, since the threads share it by its address
|
| | ~MultiQueue () |
| | the frees of the queues
|
| Handle | handle (void) |
| | a handle for one thread, with a generator of its own
|
| std::size_t | queues (void) const |
| | the number of the queues
|
| unsigned | stickiness (void) const |
| | the operations a thread keeps its two queues for
|
| std::size_t | size (void) const |
| | the number of the pairs, counted in each queue under its lock, exact when no operation runs
|
| bool | empty (void) const |
| | whether size() is 0
|
| bool | consistent (void) const |
| | the buffers of each queue ordered and holding its least pairs, and the atomic minima equal to them; under each lock in turn, with no operation running
|
template<class K, class T, class Less = std::less< K >, template< class, class > class H = MultiQueueHeap>
class ADS::MultiQueue< K, T, Less, H >
a relaxed PRIORITY QUEUE shared by threads: \( n \) queues under locks, the pop from the better of two, each queue an H behind two buffers
template<class K, class T, class Less = std::less< K >, template< class, class > class H = MultiQueueHeap>
| ADS::MultiQueue< K, T, Less, H >::MultiQueue |
( |
std::size_t | n, |
|
|
unsigned | s = 16, |
|
|
std::uint64_t | seed = 1, |
|
|
Less | less = Less() ) |
|
explicit |
the structure of \( n \) empty queues, kept by a thread for \( s \) operations, with the draws from the seed seed; \( n = 2 p \) for \( p \) threads, \( n = 1 \) an exact queue
- Precondition
- \( n \ge 1 \) and \( s \ge 1 \)
template<class K, class T, class Less = std::less< K >, template< class, class > class H = MultiQueueHeap>
the buffers of each queue ordered and holding its least pairs, and the atomic minima equal to them; under each lock in turn, with no operation running
template<class K, class T, class Less = std::less< K >, template< class, class > class H = MultiQueueHeap>
the number of the pairs, counted in each queue under its lock, exact when no operation runs