Skip to content

Commit ac8a3e4

Browse files
committed
introduce mpsc_weak_queue / bounded_ticket_queue
Add Dmitry Vyukov's queues
1 parent 3580859 commit ac8a3e4

18 files changed

Lines changed: 3215 additions & 7 deletions

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ target_include_directories(boost_lockfree INTERFACE include)
1919

2020
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.23 AND BOOST_LOCKFREE_USE_FILE_SET)
2121
set(Headers
22+
include/boost/lockfree/bounded_ticket_queue.hpp
23+
include/boost/lockfree/mpsc_weak_queue.hpp
2224
include/boost/lockfree/spsc_queue.hpp
2325
include/boost/lockfree/spsc_value.hpp
2426
include/boost/lockfree/policies.hpp
@@ -28,6 +30,7 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.23 AND BOOST_LOCKFREE_USE_FILE_SET)
2830
include/boost/lockfree/detail/copy_payload.hpp
2931
include/boost/lockfree/detail/freelist.hpp
3032
include/boost/lockfree/detail/parameter.hpp
33+
include/boost/lockfree/detail/power_of_two.hpp
3134
include/boost/lockfree/detail/prefix.hpp
3235
include/boost/lockfree/detail/tagged_ptr.hpp
3336
include/boost/lockfree/detail/tagged_ptr_dcas.hpp

doc/lockfree.qbk

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[library Boost.Lockfree
22
[quickbook 1.4]
33
[authors [Blechmann, Tim]]
4-
[copyright 2008-2011 Tim Blechmann]
4+
[copyright 2008-2026 Tim Blechmann]
55
[category algorithms]
66
[purpose
77
lockfree concurrent data structures
@@ -115,15 +115,25 @@ lock-freedom:
115115

116116
[h2 Data Structures]
117117

118-
_lockfree_ implements four lock-free data structures:
118+
_lockfree_ implements six lock-free data structures:
119119

120120
[variablelist
121121
[[[classref boost::lockfree::queue]]
122-
[a lock-free multi-producer/multi-consumer queue]
122+
[a lock-free multi-producer/multi-consumer queue (Based on Michael & Scott's algorithm)]
123+
]
124+
125+
[[[classref boost::lockfree::bounded_ticket_queue]]
126+
[a bounded multi-producer/multi-consumer queue based on the Dyukov turnstile
127+
(Vyukov bounded MPMC algorithm). Configurable via `single_producer<>` and
128+
`single_consumer<>` policy tags to obtain wait-free push or pop.]
129+
]
130+
131+
[[[classref boost::lockfree::mpsc_weak_queue]]
132+
[a multi-producer/single-consumer queue (Based on Dmitry Vyukov's algorithm)]
123133
]
124134

125135
[[[classref boost::lockfree::stack]]
126-
[a lock-free multi-producer/multi-consumer stack]
136+
[a lock-free multi-producer/multi-consumer stack (Based on Treiber's algorithm)]
127137
]
128138

129139
[[[classref boost::lockfree::spsc_queue]]
@@ -160,6 +170,16 @@ The data structures can be configured with [@boost:/libs/parameter/doc/html/inde
160170
[[[classref boost::lockfree::allow_multiple_reads]]
161171
[Configures the [classref boost::lockfree::spsc_value] to allow the content to be read multiple times.]
162172
]
173+
174+
[[[classref boost::lockfree::single_producer]]
175+
[Configures a data structure for single-producer usage. When set to `true`, push
176+
does not use a CAS and is wait-free. Only valid for [classref boost::lockfree::bounded_ticket_queue].]
177+
]
178+
179+
[[[classref boost::lockfree::single_consumer]]
180+
[Configures a data structure for single-consumer usage. When set to `true`, pop
181+
does not use a CAS and is wait-free. Only valid for [classref boost::lockfree::bounded_ticket_queue].]
182+
]
163183
]
164184

165185

@@ -278,6 +298,7 @@ _lockfree_ requires a c++14 compliant compiler. Users of MSVC are strongly recom
278298
# [@http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.37.3574 Simple, Fast, and Practical Non-Blocking and Blocking Concurrent Queue Algorithms by Michael Scott and Maged Michael],
279299
In Symposium on Principles of Distributed Computing, pages 267–275, 1996.
280300
# [@http://books.google.com/books?id=pFSwuqtJgxYC M. Herlihy & Nir Shavit. The Art of Multiprocessor Programming], Morgan Kaufmann Publishers, 2008
301+
# [@http://www.1024cores.net/home/lock-free-algorithms/queues/intrusive-mpsc-node-based-queue Multiple Producer Single Consumer Lock-Free Queue by Dmitry Vyukov], 2010
281302

282303
[endsect]
283304

0 commit comments

Comments
 (0)