diff options
author | ddoarn <ddoarn@yandex-team.ru> | 2022-02-10 16:49:52 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:52 +0300 |
commit | 0783fe3f48d91a3b741ce2ea32b11fbfc1637e7e (patch) | |
tree | 6d6a79d83e5003eaf4d45cac346113c1137cb886 /library/cpp/threading/queue | |
parent | 9541fc30d6f0877db9ff199a16f7fc2505d46a5c (diff) | |
download | ydb-0783fe3f48d91a3b741ce2ea32b11fbfc1637e7e.tar.gz |
Restoring authorship annotation for <ddoarn@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/threading/queue')
-rw-r--r-- | library/cpp/threading/queue/mpsc_read_as_filled.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/library/cpp/threading/queue/mpsc_read_as_filled.h b/library/cpp/threading/queue/mpsc_read_as_filled.h index be33ba5a58..7670fc4c6f 100644 --- a/library/cpp/threading/queue/mpsc_read_as_filled.h +++ b/library/cpp/threading/queue/mpsc_read_as_filled.h @@ -4,14 +4,14 @@ Completely wait-free queue, multiple producers - one consumer. Strict order. The queue algorithm is using concept of virtual infinite array. - A producer takes a number from a counter and atomically increments the counter. + A producer takes a number from a counter and atomically increments the counter. The number taken is a number of a slot for the producer to put a new message into infinite array. Then producer constructs a virtual infinite array by bidirectional linked list of blocks. Each block contains several slots. - There is a hint pointer which optimistically points to the last block + There is a hint pointer which optimistically points to the last block of the list and never goes backward. Consumer exploits the property of the hint pointer always going forward @@ -25,7 +25,7 @@ Consumer can't stop the progress for producers. Consumer can skip not-yet-filled slots and read them later. Thus no producer can stop the progress for consumer. - The algorithm is virtually strictly ordered because it skips slots only + The algorithm is virtually strictly ordered because it skips slots only if it is really does not matter in which order the slots were produced and consumed. @@ -35,7 +35,7 @@ WARNING: though the algorithm itself is completely wait-free but producers and consumer could be blocked by memory allocator - WARNING: copy constructors of the queue are not thread-safe + WARNING: copy constructors of the queue are not thread-safe */ #include <util/generic/deque.h> |