ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
concurrent Directory Reference

Files

 
Backoff.h
 The exponential backoff of a thread that waits for a word of memory to change, beyond the book: the \( k \)-th call of pause() runs \( 2^{\min\{ k , S \}} \) pauses of the processor (pause on x86, yield on AArch64) while \( k \le S \), and from then on gives the processor back to the system (std::this_thread::yield()), so that a wait that ends soon costs no system call and one that lasts lets the other threads run; reset() starts again from one pause, after the wait has ended or the thread has done some work.
 
ConcurrentCuckooTable.h
 A hash table that many threads read and change at once, beyond the book: the cuckoo hashing with buckets of 4 places and tags of 8 bits of BucketCuckooTable [see BucketCuckooTable.h], made concurrent with one lock per region of buckets and, for keys and values that can be read atomically, lookups that take no lock at all.
 
ConcurrentFlatTable.h
 A hash table that many threads read and grow at once, beyond the book: open addressing with linear probing on a vector of atomic words of 64 bits, the folklore table that Maier, Sanders and Dementiev found the fastest to read, made to grow while the threads work and to keep its pairs where they are.
 
ConcurrentUnionFind.h
 The union-find that many threads change at once, beyond the book [see UnionFind.h for the sequential ones]: the \( n \) elements \( 0 , \ldots , n - 1 \) in a forest of parents, a root being its own parent, each parent an atomic word changed only by compare-and-swap, with no lock.
 
EventCount.h
 An event count, beyond the book: the way for a thread to sleep until a condition on a lock-free structure holds, instead of looking at it again and again or between sleeps of a fixed length, with no lock and nearly no cost for the threads that make the condition true while nobody waits.
 
LockFreePriorityQueue.h
 A priority queue shared by threads that is exact, linearizable and lock-free, beyond the book: the skiplist of Lindén and Jonsson, whose DeleteMin pays one read-modify-write in the common case and leaves the nodes it deletes in the list, to be cut off in batches.
 
MinBoard.h
 A board of the least keys of \( p \) threads, beyond the book: each thread \( i \) owns a slot, where publish( i , k ) writes its key \( k \) (e.g., the least \( f \) of the OPEN list of a worker of a parallel search), and any thread reads by min() the least of the slots (the bound that the workers compare their own with).
 
MPMCQueue.h
 A bounded queue of many producers and many consumers, beyond the book: the circular vector of Vyukov, whose places carry a sequence number besides the item.
 
MPSCInbox.h
 An inbox that many producer threads fill and one consumer thread empties, lock-free, beyond the book: the messages to a worker of a parallel search, e.g., the nodes that the other workers send to their owner.
 
MPSCQueue.h
 A queue that many producer threads fill and one consumer thread empties, lock-free and unbounded, beyond the book: each producer has a lane of its own, so that the producers never compete with each other, and a lane is a list of blocks of \( B \) places between its producer and the consumer.
 
MultiQueue.h
 A relaxed priority queue shared by threads, beyond the book: the MultiQueue of Rihani, Sanders and Dementiev, with the stickiness and the buffers of Williams, Sanders and Dementiev.
 
SingleWriterFlatTable.h
 A hash table that one thread writes and many threads read at once, beyond the book: the open addressing with linear probing of ConcurrentFlatTable [see ConcurrentFlatTable.h] for a table that only its owner fills, e.g., the CLOSED set of a worker of a parallel search that the others read to prune their own states.
 
SPSCQueue.h
 A bounded queue between one producer thread and one consumer thread, lock-free and wait-free, beyond the book: the circular vector of the queue of section 4.3.3 [see ArrayQueue.h], whose head only the consumer writes and whose tail only the producer writes, so that each index is an atomic with the release and acquire orders and no lock is needed (the queue of Lamport).
 
StealablePriorityQueue.h
 The priority queue of one worker that the other workers steal from, beyond the book, and the frontier of \( p \) such queues of a parallel best-first search or branch-and-bound with work stealing.
 
WorkStealingDeque.h
 The deque of work stealing of Chase and Lev, beyond the book: its owner thread pushes and takes at the bottom, as on a stack, and any other thread steals from the top, lock-free, the items on a circular vector of \( 2^k \) places that the owner doubles when it is full.