|
ADS
Algorithms and Data Structures
|
an exact PRIORITY QUEUE shared by threads, linearizable and lock-free: the skiplist of Lindén and Jonsson, its deleted prefix cut in batches More...
#include <ADS/concurrent/LockFreePriorityQueue.h>
Classes | |
| struct | Entry |
| a pair of the queue, its key and its item More... | |
| struct | Counts |
| what a handle counted of its operations, for comparisons that do not time: the read-modify-writes, those that failed, the nodes walked by the DeleteMin, and the cuts of the prefix More... | |
| class | Handle |
| the access of one thread to a LockFreePriorityQueue: its record of the epochs, the generator of its heights and the counter of its stamps More... | |
Public types | |
| using | Key = K |
| the type of the keys | |
| using | Item = T |
| the type of the items | |
Public member functions | |
| LockFreePriorityQueue (unsigned offset=32, std::uint64_t seed=1, Less less=Less()) | |
| the empty queue, whose DeleteMin cut the prefix once they walked more than \( b \) = offset nodes, with the heights drawn from the seed seed | |
| LockFreePriorityQueue (const LockFreePriorityQueue &)=delete | |
| no copy, since the threads share it by its address | |
| LockFreePriorityQueue & | operator= (const LockFreePriorityQueue &)=delete |
| no copy, since the threads share it by its address | |
| ~LockFreePriorityQueue () | |
| the frees of the nodes, of those waiting for their epoch and of the records | |
| Handle | handle (void) |
| a handle for one thread, on a record of the epochs of its own | |
| unsigned | offset (void) const |
| the length \( b \) of the prefix past which a DeleteMin cuts it | |
| std::size_t | size (void) const |
| the number of the pairs, i.e., of the nodes not deleted of level 0; with no operation running | |
| bool | empty (void) const |
| whether size() is 0; with no operation running | |
| std::size_t | prefix (void) const |
| the number of the deleted nodes still in the list of level 0; with no operation running | |
| bool | consistent (void) const |
| the invariants of the lists: the deleted nodes a prefix of level 0, the rest ordered by (key, stamp), each upper level a subsequence of level 0 from the first node of the head, no node being inserted; with no operation running | |
Static public attributes | |
| static constexpr decrease_key_kind | decrease_key = decrease_key_kind::lazy |
| a queue with no handles on the pairs, on which a search lowers a key by a new insertion [see decrease_key_of() of Capabilities.h] | |
| static constexpr int | kLevels = 32 |
| the levels of the skiplist | |
an exact PRIORITY QUEUE shared by threads, linearizable and lock-free: the skiplist of Lindén and Jonsson, its deleted prefix cut in batches
| using ADS::LockFreePriorityQueue< K, T, Less >::Item = T |
the type of the items
| using ADS::LockFreePriorityQueue< K, T, Less >::Key = K |
the type of the keys
|
explicit |
the empty queue, whose DeleteMin cut the prefix once they walked more than \( b \) = offset nodes, with the heights drawn from the seed seed
|
delete |
no copy, since the threads share it by its address
| ADS::LockFreePriorityQueue< K, T, Less >::~LockFreePriorityQueue | ( | ) |
the frees of the nodes, of those waiting for their epoch and of the records
|
nodiscard |
the invariants of the lists: the deleted nodes a prefix of level 0, the rest ordered by (key, stamp), each upper level a subsequence of level 0 from the first node of the head, no node being inserted; with no operation running
|
nodiscard |
whether size() is 0; with no operation running
|
nodiscard |
a handle for one thread, on a record of the epochs of its own
|
inlinenodiscard |
the length \( b \) of the prefix past which a DeleteMin cuts it
|
delete |
no copy, since the threads share it by its address
|
nodiscard |
the number of the deleted nodes still in the list of level 0; with no operation running
|
nodiscard |
the number of the pairs, i.e., of the nodes not deleted of level 0; with no operation running
|
staticconstexpr |
a queue with no handles on the pairs, on which a search lowers a key by a new insertion [see decrease_key_of() of Capabilities.h]
|
staticconstexpr |
the levels of the skiplist