[med-svn] [Git][med-team/libatomic-queue][master] 7 commits: New upstream version 0.0+git20211209.7db4cea

Andreas Tille (@tille) gitlab at salsa.debian.org
Tue Dec 21 20:46:45 GMT 2021



Andreas Tille pushed to branch master at Debian Med / libatomic-queue


Commits:
781b0330 by Andreas Tille at 2021-12-21T18:29:28+01:00
New upstream version 0.0+git20211209.7db4cea
- - - - -
0a0130c7 by Andreas Tille at 2021-12-21T18:29:28+01:00
routine-update: New upstream version

- - - - -
6d3fb482 by Andreas Tille at 2021-12-21T18:29:35+01:00
Update upstream source from tag 'upstream/0.0+git20211209.7db4cea'

Update to upstream version '0.0+git20211209.7db4cea'
with Debian dir 358567cc0e01bbac767c8032551ad2d7fcc45165
- - - - -
8e7eac88 by Andreas Tille at 2021-12-21T18:36:53+01:00
Adapt patches to new upstream version

- - - - -
b37db158 by Andreas Tille at 2021-12-21T18:40:35+01:00
Leave upstream warning compiler options

- - - - -
68ef576a by Andreas Tille at 2021-12-21T18:44:39+01:00
Fix symbols file

- - - - -
017186cc by Andreas Tille at 2021-12-21T21:28:36+01:00
Fix lintian override

- - - - -


27 changed files:

- .github/workflows/c-cpp.yml
- .gitignore
- Makefile
- README.md
- − _config.yml
- debian/changelog
- debian/control
- debian/libatomic-queue0.symbols
- debian/patches/generate-shared-library.patch
- debian/patches/no-native
- debian/source/lintian-overrides
- html/benchmarks.html
- html/benchmarks.js
- include/atomic_queue/atomic_queue.h
- include/atomic_queue/defs.h
- meson.build
- + meson_options.txt
- − results/results-16.20191220T000148.txt
- − results/results-16.20200119T235604.txt
- − results/results-28.20191221T010636.txt
- − results/results-28.20200126T222915.txt
- + results/results-32.20210418T004017.txt
- − results/results-8.20191005T041115.txt
- scripts/benchmark-epilogue.sh
- scripts/benchmark-prologue.sh
- − scripts/plot_scalability.py
- src/tests.cc


Changes:

=====================================
.github/workflows/c-cpp.yml
=====================================
@@ -1,4 +1,4 @@
-name: C/C++ CI
+name: Ubuntu continuous integration
 
 on:
   push:
@@ -13,6 +13,8 @@ jobs:
 
     steps:
     - uses: actions/checkout at v2
+    - name: Install Boost
+      run: sudo apt-get --quiet --yes install libboost-test-dev
     - name: Environment variables
       run: make env; make TOOLSET=gcc versions; make TOOLSET=clang versions
     - name: Unit tests with gcc


=====================================
.gitignore
=====================================
@@ -1,2 +1,3 @@
 *~
 build/
+__pycache__/


=====================================
Makefile
=====================================
@@ -28,7 +28,7 @@ AR := ${ar.${TOOLSET}}
 
 cxxflags.gcc.debug := -Og -fstack-protector-all -fno-omit-frame-pointer # -D_GLIBCXX_DEBUG
 cxxflags.gcc.release := -O3 -mtune=native -ffast-math -falign-{functions,loops}=64 -DNDEBUG
-cxxflags.gcc := -pthread -march=native -std=gnu++14 -W{all,extra,error,no-{maybe-uninitialized,unused-function,unused-local-typedefs}} -g -fmessage-length=0 ${cxxflags.gcc.${BUILD}}
+cxxflags.gcc := -pthread -march=native -std=gnu++14 -W{all,extra,error,no-{maybe-uninitialized,unused-variable,unused-function,unused-local-typedefs}} -g -fmessage-length=0 ${cxxflags.gcc.${BUILD}}
 
 cflags.gcc := -pthread -march=native -W{all,extra} -g -fmessage-length=0 ${cxxflags.gcc.${BUILD}}
 
@@ -45,13 +45,6 @@ cppflags := ${CPPFLAGS} -Iinclude
 ldflags := -fuse-ld=gold -pthread -g ${ldflags.${TOOLSET}} ${LDFLAGS}
 ldlibs := -lrt ${LDLIBS}
 
-ifdef BOOST_ROOT_1_72_0 # E.g./opt/hostedtoolcache/boost/1.72.0/x64
-boost_unit_test_framework_inc := -I${BOOST_ROOT_1_72_0}
-boost_unit_test_framework_lib := -{L,'Wl,-rpath='}${BOOST_ROOT_1_72_0}/lib -lboost_unit_test_framework-mt-x64
-else
-boost_unit_test_framework_lib := -lboost_unit_test_framework
-endif
-
 cppflags.tbb :=
 ldlibs.tbb := {-L,'-Wl,-rpath='}/usr/local/lib -ltbb
 
@@ -85,7 +78,7 @@ ${build_dir}/benchmarks : ${benchmarks_src:%.cc=${build_dir}/%.o} Makefile | ${b
 
 tests_src := tests.cc
 ${build_dir}/tests : cppflags += ${boost_unit_test_framework_inc} -DBOOST_TEST_DYN_LINK=1
-${build_dir}/tests : ldlibs += ${boost_unit_test_framework_lib}
+${build_dir}/tests : ldlibs += -lboost_unit_test_framework
 ${build_dir}/tests : ${tests_src:%.cc=${build_dir}/%.o} Makefile | ${build_dir}
 	$(strip ${LINK.EXE})
 -include ${tests_src:%.cc=${build_dir}/%.d}
@@ -133,13 +126,13 @@ ${build_dir} :
 	mkdir -p $@
 
 rtags : clean
-	${MAKE} -nk | rc -c -; true
+	${MAKE} -nk all | rtags-rc -c -; true
 
 clean :
 	rm -rf ${build_dir} ${exes}
 
 env :
-	env | sort
+	env | sort --ignore-case
 
 versions:
 	${MAKE} --version | head -n1


=====================================
README.md
=====================================
@@ -1,8 +1,14 @@
-[![C/C++ CI](https://github.com/max0x7ba/atomic_queue/workflows/C/C++%20CI/badge.svg)](https://github.com/max0x7ba/atomic_queue/actions?query=workflow%3A%22C%2FC%2B%2B+CI%22)
+[![C++14](https://img.shields.io/badge/dialect-C%2B%2B14-blue)](https://en.cppreference.com/w/cpp/14)
+[![MIT license](https://img.shields.io/github/license/max0x7ba/atomic_queue)](https://github.com/max0x7ba/atomic_queue/blob/master/LICENSE)
+![platform Linux 64-bit](https://img.shields.io/badge/platform-Linux%2064--bit-yellow)
+![Latest release](https://img.shields.io/github/v/tag/max0x7ba/atomic_queue?label=latest%20release)
+[![Ubuntu continuous integration](https://github.com/max0x7ba/atomic_queue/workflows/Ubuntu%20continuous%20integration/badge.svg)](https://github.com/max0x7ba/atomic_queue/actions?query=workflow%3A%22Ubuntu%20continuous%20integration%22)
 
 # atomic_queue
 C++14 multiple-producer-multiple-consumer *lockless* queues based on circular buffer with [`std::atomic`][3].
 
+It has been developed, tested and benchmarked on Linux, but should support any C++14 platforms which implement `std::atomic`.
+
 The main design principle these queues follow is _minimalism_: the bare minimum of atomic operations, fixed size buffer, value semantics.
 
 These qualities are also limitations:
@@ -22,7 +28,7 @@ These containers have corresponding `AtomicQueueB`, `OptimistAtomicQueueB`, `Ato
 
 Totally ordered mode is supported. In this mode consumers receive messages in the same FIFO order the messages were posted. This mode is supported for `push` and `pop` functions, but for not the `try_` versions. On Intel x86 the totally ordered mode has 0 cost, as of 2019.
 
-Single-producer-single-consumer mode is supported. In this mode, no read-modify-write instructions are necessary, only the atomic loads and stores. That improves queue throughput significantly.
+Single-producer-single-consumer mode is supported. In this mode, no expensive atomic read-modify-write CPU instructions are necessary, only the cheapest atomic loads and stores. That improves queue throughput significantly.
 
 A few other thread-safe containers are used for reference in the benchmarks:
 * `std::mutex` - a fixed size ring-buffer with `std::mutex`.
@@ -40,6 +46,7 @@ A few other thread-safe containers are used for reference in the benchmarks:
 # Using the library
 The containers provided are header-only class templates, no building/installing is necessary.
 
+## Install from GitHub
 1. Clone the project:
 ```
 git clone https://github.com/max0x7ba/atomic_queue.git
@@ -47,6 +54,10 @@ git clone https://github.com/max0x7ba/atomic_queue.git
 2. Add `atomic_queue/include` directory (use full path) to the include paths of your build system.
 3. `#include <atomic_queue/atomic_queue.h>` in your C++ source.
 
+## Install using vcpkg
+```
+vcpkg install atomic-queue
+```
 
 ## Benchmark build and run instructions
 The containers provided are header-only class templates that require only `#include <atomic_queue/atomic_queue.h>`, no building/installing is necessary.
@@ -68,13 +79,15 @@ The benchmark also requires Intel TBB library to be available. It assumes that i
 The containers support the following APIs:
 * `try_push` - Appends an element to the end of the queue. Returns `false` when the queue is full.
 * `try_pop` - Removes an element from the front of the queue. Returns `false` when the queue is empty.
-* `push` - Appends an element to the end of the queue. Busy waits when the queue is full. Faster than `try_push` when the queue is not full. Optional FIFO producer queuing and total order.
-* `pop` - Removes an element from the front of the queue. Busy waits when the queue is empty. Faster than `try_pop` when the queue is not empty. Optional FIFO consumer queuing and total order.
+* `push` (optimist) - Appends an element to the end of the queue. Busy waits when the queue is full. Faster than `try_push` when the queue is not full. Optional FIFO producer queuing and total order.
+* `pop` (optimist) - Removes an element from the front of the queue. Busy waits when the queue is empty. Faster than `try_pop` when the queue is not empty. Optional FIFO consumer queuing and total order.
 * `was_size` - Returns the number of unconsumed elements during the call. The state may have changed by the time the return value is examined.
 * `was_empty` - Returns `true` if the container was empty during the call. The state may have changed by the time the return value is examined.
 * `was_full` - Returns `true` if the container was full during the call. The state may have changed by the time the return value is examined.
 * `capacity` - Returns the maximum number of elements the queue can possibly hold.
 
+Note that _optimism_ is a choice of a queue modification operation control flow, rather than a queue type. An _optimist_ `push` is fastest when the queue is not full most of the time, an optimistic `pop` - when the queue is not empty most of the time. Optimistic and not so operations can be mixed with no restrictions. The `OptimistAtomicQueue`s in [the benchmarks][1] use only _optimist_ `push` and `pop`.
+
 See [example.cc](src/example.cc) for a usage example.
 
 TODO: full API reference.
@@ -82,16 +95,16 @@ TODO: full API reference.
 # Implementation Notes
 The available queues here use a ring-buffer array for storing elements. The size of the queue is fixed at compile time or construction time.
 
-In a production multiple-producer-multiple-consumer scenario the ring-buffer size should be set to the maximum allowable queue size. When the buffer size is exhausted it means that the consumers cannot consume the elements fast enough, fixing which would require either of:
+In a production multiple-producer-multiple-consumer scenario the ring-buffer size should be set to the maximum expected queue size. When the ring-buffer gets full it means that the consumers cannot consume the elements fast enough. A fix for that is any of:
 
-* increasing the buffer size to be able to handle temporary spikes of produced elements, or
-* increasing the number of consumers to consume elements faster, or
-* decreasing the number of producers to producer fewer elements.
+* increase the buffer size to be able to handle temporary spikes of produced elements, or,
+* increase the number of consumers to consume elements faster, or,
+* decrease the number of producers to producer fewer elements.
 
 Using a power-of-2 ring-buffer array size allows a couple of important optimizations:
 
-* The writer and reader indexes get mapped into the ring-buffer array index using remainder binary operator `% SIZE` and using a power-of-2 size turns that remainder operator into one plain `and` instruction and that is as fast as it gets.
-* The *element index within the cache line* gets swapped with the *cache line index* within the *ring-buffer array element index*, so that subsequent queue elements actually reside in different cache lines. This eliminates contention between producers and consumers on the ring-buffer cache lines. Instead of `N` producers together with `M` consumers competing on the same ring-buffer array cache line in the worst case, it is only one producer competing with one consumer. This optimisation scales better with the number of producers and consumers, and element size. With low number of producers and consumers (up to about 2 of each in these benchmarks) disabling this optimisation may yield better throughput (but higher variance across runs).
+* The writer and reader indexes get mapped into the ring-buffer array index using remainder binary operator `% SIZE`. Remainder binary operator `%` normally generates a division CPU instruction which isn't cheap, but using a power-of-2 size turns that remainder operator into one cheap binary `and` CPU instruction and that is as fast as it gets.
+* The *element index within the cache line* gets swapped with the *cache line index*, so that consecutive queue elements reside in different cache lines. This massively reduces cache line contention between multiple producers and multiple consumers. Instead of `N` producers together with `M` consumers competing on subsequent elements in the same ring-buffer cache line in the worst case, it is only one producer competing with one consumer (pedantically, when the number of CPUs is not greater than the number of elements that can fit in one cache line). This optimisation scales better with the number of producers and consumers, and element size. With low number of producers and consumers (up to about 2 of each in these benchmarks) disabling this optimisation may yield better throughput (but higher variance across runs).
 
 The containers use `unsigned` type for size and internal indexes. On x86-64 platform `unsigned` is 32-bit wide, whereas `size_t` is 64-bit wide. 64-bit instructions utilise an extra byte instruction prefix resulting in slightly more pressure on the CPU instruction cache and the front-end. Hence, 32-bit `unsigned` indexes are used to maximise performance. That limits the queue size to 4,294,967,295 elements, which seems to be a reasonable hard limit for many applications.
 
@@ -101,7 +114,11 @@ While the atomic queues can be used with any moveable element types (including `
 
 So, ideally, you may like to run your critical low-latency code on isolated cores that also no other processes can possibly use. And disable [real-time thread throttling](#real-time-thread-throttling) to prevent `SCHED_FIFO` real-time threads from being throttled.
 
-Some people proposed busy-waiting with a call to `sched_yield`/`pthread_yield`. However, `sched_yield` is a wrong tool for locking because it doesn't communicate to the OS kernel what the thread is waiting for, so that the OS scheduler can never wake up the calling thread at the "right" time, unless there are no other threads that can run on this CPU. [More details about `sched_yield` and spinlocks from Linus Torvalds](https://www.realworldtech.com/forum/?threadid=189711&curpostid=189752).
+People often propose limiting busy-waiting with a subsequent call to `sched_yield`/`pthread_yield`. However, `sched_yield` is a wrong tool for locking because it doesn't communicate to the OS kernel what the thread is waiting for, so that the OS thread scheduler can never reschedule the calling thread to resume when the shared state has changed (unless there are no other threads that can run on this CPU core, so that the caller resumes immediately). [More details about `sched_yield` and spinlocks from Linus Torvalds][5].
+
+[In Linux, there is mutex type `PTHREAD_MUTEX_ADAPTIVE_NP`][9] which busy-waits a locked mutex for a number of iterations and then makes a blocking syscall into the kernel to deschedule the waiting thread. In the benchmarks it was the worst performer and I couldn't find a way to make it perform better, and that's the reason it is not included in the benchmarks.
+
+On Intel CPUs one could use [the 4 debug control registers][6] to monitor the spinlock memory region for write access and wait on it using `select` (and its friends) or `sigwait` (see [`perf_event_open`][7] and [`uapi/linux/hw_breakpoint.h`][8] for more details). A spinlock waiter could suspend itself with `select` or `sigwait` until the spinlock state has been updated. But there are only 4 of these registers, so that such a solution wouldn't scale.
 
 # Benchmarks
 [View throughput and latency benchmarks charts][1].
@@ -137,15 +154,16 @@ One thread posts an integer to another thread through one queue and waits for a
 # Contributing
 The project uses `.editorconfig` and `.clang-format` to automate formatting. Pull requests are expected to be formatted using these settings.
 
-## Help needed
-* Submit pull requests with benchmarking code for other queues. The queues should be somewhat widely used or have exceptional performance, not my-first-mpmc-queue type projects.
-* Benchmarking results on different architectures or with much more cores, in particular on AMD Ryzen CPUs. Run `scripts/run-benchmarks.sh` and email me the results file, or put it under `results/` and submit a pull request.
-
 ---
 
 Copyright (c) 2019 Maxim Egorushkin. MIT License. See the full licence in file LICENSE.
 
 [1]: https://max0x7ba.github.io/atomic_queue/html/benchmarks.html
 [2]: https://www.kernel.org/doc/html/latest/scheduler/sched-rt-group.html
-[3]: https://en.cppreference.com/w/cpp/header/atomic
+[3]: https://en.cppreference.com/w/cpp/atomic/atomic
 [4]: https://repositum.tuwien.ac.at/obvutwhs/download/pdf/2582190?originalFilename=true
+[5]: https://www.realworldtech.com/forum/?threadid=189711&curpostid=189752
+[6]: https://en.wikipedia.org/wiki/X86_debug_register#DR7_-_Debug_control
+[7]: https://man7.org/linux/man-pages/man2/perf_event_open.2.html
+[8]: https://github.com/torvalds/linux/blob/master/include/uapi/linux/hw_breakpoint.h
+[9]: https://stackoverflow.com/a/25168942/412080


=====================================
_config.yml deleted
=====================================
@@ -1 +0,0 @@
-theme: jekyll-theme-midnight
\ No newline at end of file


=====================================
debian/changelog
=====================================
@@ -1,3 +1,12 @@
+libatomic-queue (0.0+git20211209.7db4cea-1) UNRELEASED; urgency=medium
+
+  * New upstream version
+  * Fix symbols file
+    Closes: #1002253
+  * Fix lintian override
+
+ -- Andreas Tille <tille at debian.org>  Tue, 21 Dec 2021 18:29:28 +0100
+
 libatomic-queue (0.0+git20201108.d9d66b6-4) unstable; urgency=medium
 
   * Fix symbols (Closes: #997408)


=====================================
debian/control
=====================================
@@ -1,9 +1,10 @@
 Source: libatomic-queue
-Priority: optional
 Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
 Uploaders: Steffen Moeller <moeller at debian.org>,
            Andreas Tille <tille at debian.org>,
            Nilesh Patra <nilesh at debian.org>
+Section: libs
+Priority: optional
 Build-Depends: debhelper-compat (= 13),
                d-shlibs,
                libboost-dev,
@@ -11,12 +12,11 @@ Build-Depends: debhelper-compat (= 13),
                libconcurrentqueue-dev,
                libreaderwriterqueue-dev,
                libtbb-dev,
-               libxenium-dev (>= 0.0.2+ds-2~)
+               libxenium-dev
 Standards-Version: 4.6.0
-Section: libs
-Homepage: https://github.com/max0x7ba/atomic_queue
 Vcs-Browser: https://salsa.debian.org/med-team/libatomic-queue
 Vcs-Git: https://salsa.debian.org/med-team/libatomic-queue.git
+Homepage: https://github.com/max0x7ba/atomic_queue
 Rules-Requires-Root: no
 
 Package: libatomic-queue0
@@ -59,8 +59,8 @@ Description: C++ atomic_queue library
  This package contains the dynamic library.
 
 Package: libatomic-queue-dev
-Section: libdevel
 Architecture: any
+Section: libdevel
 Depends: libatomic-queue0 (= ${binary:Version}),
          libboost-dev,
          ${shlibs:Depends},


=====================================
debian/libatomic-queue0.symbols
=====================================
@@ -88,7 +88,6 @@ libatomic_queue.so.0 libatomic-queue0 #MINVER#
  _ZNSt5dequeINSt8__detail9_StateSeqINSt7__cxx1112regex_traitsIcEEEESaIS5_EE12emplace_backIJS5_EEEvDpOT_ at Base 0.0+git20201007.df79403
  _ZNSt5dequeINSt8__detail9_StateSeqINSt7__cxx1112regex_traitsIcEEEESaIS5_EE16_M_push_back_auxIJRKS5_EEEvDpOT_ at Base 0.0+git20201007.df79403
  _ZNSt5dequeINSt8__detail9_StateSeqINSt7__cxx1112regex_traitsIcEEEESaIS5_EE17_M_reallocate_mapEmb at Base 0.0+git20201007.df79403
- _ZNSt5dequeINSt8__detail9_StateSeqINSt7__cxx1112regex_traitsIcEEEESaIS5_EE9push_backERKS5_ at Base 0.0+git20201007.df79403
  _ZNSt5dequeIlSaIlEE16_M_push_back_auxIJRKlEEEvDpOT_ at Base 0.0+git20201007.df79403
  _ZNSt6vectorIN12atomic_queue15CpuTopologyInfoESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_ at Base 0.0+git20201007.df79403
  _ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_M_realloc_insertIJRKS5_EEEvN9__gnu_cxx17__normal_iteratorIPS5_S7_EEDpOT_ at Base 0.0+git20201007.df79403
@@ -233,8 +232,4 @@ libatomic_queue.so.0 libatomic-queue0 #MINVER#
  _ZZNKSt8__detail9_ExecutorIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESaINS5_9sub_matchISB_EEENS5_12regex_traitsIcEELb0EE10_M_is_wordEcE3__s at Base 0.0+git20201007.df79403
  _ZZNKSt8__detail9_ExecutorIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESaINS5_9sub_matchISB_EEENS5_12regex_traitsIcEELb1EE10_M_is_wordEcE3__s at Base 0.0+git20201007.df79403
  _ZZNSt19_Sp_make_shared_tag5_S_tiEvE5__tag at Base 0.0+git20201007.df79403
-#MISSING: 0.0+git20201108.d9d66b6-3# _ZZNSt8__detail9_CompilerINSt7__cxx1112regex_traitsIcEEE18_M_expression_termILb0ELb0EEEbRSt4pairIbcERNS_15_BracketMatcherIS3_XT_EXT0_EEEENKUlcE_clEc at Base 0.0+git20201108.d9d66b6
-#MISSING: 0.0+git20201108.d9d66b6-3# _ZZNSt8__detail9_CompilerINSt7__cxx1112regex_traitsIcEEE18_M_expression_termILb0ELb1EEEbRSt4pairIbcERNS_15_BracketMatcherIS3_XT_EXT0_EEEENKUlcE_clEc at Base 0.0+git20201108.d9d66b6
- _ZZNSt8__detail9_CompilerINSt7__cxx1112regex_traitsIcEEE18_M_expression_termILb1ELb0EEEbRSt4pairIbcERNS_15_BracketMatcherIS3_XT_EXT0_EEEENKUlcE_clEc at Base 0.0+git20201007.df79403
- _ZZNSt8__detail9_CompilerINSt7__cxx1112regex_traitsIcEEE18_M_expression_termILb1ELb1EEEbRSt4pairIbcERNS_15_BracketMatcherIS3_XT_EXT0_EEEENKUlcE_clEc at Base 0.0+git20201007.df79403
  pthread_create at Base 0.0+git20201007.df79403


=====================================
debian/patches/generate-shared-library.patch
=====================================
@@ -13,7 +13,7 @@ Description: Fix unused variable
  
  cxx.gcc := g++
  cc.gcc := gcc
-@@ -61,21 +62,30 @@ ldlibs.moodycamel :=
+@@ -54,21 +55,30 @@ ldlibs.moodycamel :=
  cppflags.xenium := -I${abspath ../xenium}
  ldlibs.xenium :=
  
@@ -46,7 +46,7 @@ Description: Fix unused variable
  benchmarks_src := benchmarks.cc cpu_base_frequency.cc huge_pages.cc
  ${build_dir}/benchmarks : cppflags += ${cppflags.tbb} ${cppflags.moodycamel} ${cppflags.xenium}
  ${build_dir}/benchmarks : ldlibs += ${ldlibs.tbb} ${ldlibs.moodycamel} ${ldlibs.xenium} -ldl
-@@ -95,9 +105,10 @@ ${build_dir}/example : ${example_src:%.c
+@@ -88,9 +98,10 @@ ${build_dir}/example : ${example_src:%.c
  	$(strip ${LINK.EXE})
  -include ${example_src:%.cc=${build_dir}/%.d}
  
@@ -60,7 +60,7 @@ Description: Fix unused variable
  
  ${build_dir}/%.a : Makefile | ${build_dir}
  	$(strip ${LINK.A})
-@@ -122,6 +133,13 @@ ${build_dir}/%.o : src/%.cc Makefile | $
+@@ -115,6 +126,13 @@ ${build_dir}/%.o : src/%.cc Makefile | $
  ${build_dir}/%.o : src/%.c Makefile | ${build_dir}
  	$(strip ${COMPILE.C})
  
@@ -74,7 +74,7 @@ Description: Fix unused variable
  %.S : cppflags += ${cppflags.tbb} ${cppflags.moodycamel} ${cppflags.xenium}
  %.S : src/%.cc Makefile | ${build_dir}
  	$(strip ${COMPILE.S})
-@@ -132,11 +150,14 @@ ${build_dir}/%.o : src/%.c Makefile | ${
+@@ -125,11 +143,14 @@ ${build_dir}/%.o : src/%.c Makefile | ${
  ${build_dir} :
  	mkdir -p $@
  
@@ -82,11 +82,11 @@ Description: Fix unused variable
 +	mkdir -p $@
 +
  rtags : clean
- 	${MAKE} -nk | rc -c -; true
+ 	${MAKE} -nk all | rtags-rc -c -; true
  
  clean :
 -	rm -rf ${build_dir} ${exes}
 +	rm -rf ${build_dir} ${exes} ${build_dir_shared}
  
  env :
- 	env | sort
+ 	env | sort --ignore-case


=====================================
debian/patches/no-native
=====================================
@@ -4,25 +4,25 @@ Bug-Debian: https://bugs.debian.org/987532
 Forwarded: not-needed
 
 It violates Debian's architectual baseline and causes reproducibilty problems
---- libatomic-queue.orig/Makefile
-+++ libatomic-queue/Makefile
-@@ -28,14 +28,14 @@
+--- a/Makefile
++++ b/Makefile
+@@ -28,14 +28,14 @@ LD := ${ld.${TOOLSET}}
  AR := ${ar.${TOOLSET}}
-
+ 
  cxxflags.gcc.debug := -Og -fstack-protector-all -fno-omit-frame-pointer # -D_GLIBCXX_DEBUG
 -cxxflags.gcc.release := -O3 -mtune=native -ffast-math -falign-{functions,loops}=64 -DNDEBUG
--cxxflags.gcc := -pthread -march=native -std=gnu++14 -W{all,extra,error,no-{maybe-uninitialized,unused-function,unused-local-typedefs}} -g -fmessage-length=0 ${cxxflags.gcc.${BUILD}}
+-cxxflags.gcc := -pthread -march=native -std=gnu++14 -W{all,extra,error,no-{maybe-uninitialized,unused-variable,unused-function,unused-local-typedefs}} -g -fmessage-length=0 ${cxxflags.gcc.${BUILD}}
 +cxxflags.gcc.release := -O3 -ffast-math -falign-{functions,loops}=64 -DNDEBUG
-+cxxflags.gcc := -pthread -std=gnu++14 -W{all,extra,error,no-{maybe-uninitialized,unused-function,unused-local-typedefs}} -g -fmessage-length=0 ${cxxflags.gcc.${BUILD}}
-
++cxxflags.gcc := -pthread -std=gnu++14 -W{all,extra,error,no-{maybe-uninitialized,unused-variable,unused-function,unused-local-typedefs}} -g -fmessage-length=0 ${cxxflags.gcc.${BUILD}}
+ 
 -cflags.gcc := -pthread -march=native -W{all,extra} -g -fmessage-length=0 ${cxxflags.gcc.${BUILD}}
 +cflags.gcc := -pthread -W{all,extra} -g -fmessage-length=0 ${cxxflags.gcc.${BUILD}}
-
+ 
  cxxflags.clang.debug := -O0 -fstack-protector-all
 -cxxflags.clang.release := -O3 -mtune=native -ffast-math -falign-functions=64 -DNDEBUG
 -cxxflags.clang := -stdlib=libstdc++ -pthread -march=native -std=gnu++14 -W{all,extra,error,no-{unused-variable,unused-function,unused-local-typedefs}} -g -fmessage-length=0 ${cxxflags.clang.${BUILD}}
 +cxxflags.clang.release := -O3 -ffast-math -falign-functions=64 -DNDEBUG
-+cxxflags.clang := -stdlib=libstdc++ -pthread -std=gnu++14 -W{all,extra,error,no-{unused-variable,unused-function,unused-local-typedefs}} -g -fmessage-length=0 ${cxxflags.clang.${BUILD}}
++cxxflags.clang := -stdlib=libstdc++ -pthread -std=gnu++14 -W{all,extra,error,no-{unused-variable,unused-function,unused-local-typedefs}} -g -fmessage-length=0 ${cxxflags.clang.        ${BUILD}}
  ldflags.clang := -stdlib=libstdc++ ${ldflags.clang.${BUILD}}
-
+ 
  # Additional CPPFLAGS, CXXFLAGS, CFLAGS, LDLIBS, LDFLAGS can come from the command line, e.g. make CPPFLAGS='-I<my-include-dir>', or from environment variables.


=====================================
debian/source/lintian-overrides
=====================================
@@ -1,2 +1,2 @@
 # False positive
-libatomic-queue source: source-is-missing html/benchmarks.js line 155 is *
+libatomic-queue source: source-is-missing html/benchmarks.js*


=====================================
html/benchmarks.html
=====================================
@@ -27,10 +27,12 @@
     <p>N producer threads push a 4-byte integer into one same queue, N consumer threads pop the integers from the queue. All producers posts 1,000,000 messages in total. Total time to send and receive all the messages is measured. The benchmark is run for from 1 producer and 1 consumer up to (total-number-of-cpus / 2) producers/consumers to measure the scalabilty of different queues.</p>
     <div class="chart" id="scalability-9900KS-5GHz"></div>
     <div class="chart" id="scalability-xeon-gold-6132"></div>
+    <div class="chart" id="scalability-ryzen-5950x"></div>
     <h1>Latency Benchmark</h1>
-    <p>One thread posts an integer to another thread through one queue and waits for a reply from another queue (2 queues in total). The benchmarks measures the total time of 100,000 ping-pongs, best of 10 runs. Contention is minimal here (1-producer-1-consumer, 1 element in the queue) to be able to achieve and measure the lowest latency. Reports the average round-trip time.</p>
+    <p>One thread posts a 4-byte integer to another thread through one queue and waits for a reply from another queue (2 queues in total). The benchmark measures the total time of 100,000 ping-pongs, best of 10 runs. Contention is minimal here (1-producer-1-consumer, 1 element in the queue) to be able to achieve and measure the lowest latency. Reports the average round-trip time.</p>
     <div class="chart" id="latency-9900KS-5GHz"></div>
     <div class="chart" id="latency-xeon-gold-6132"></div>
+    <div class="chart" id="latency-ryzen-5950x"></div>
     <h2>Systems details</h2>
     <h3>Intel i9-9900KS system</h3>
     <ul>
@@ -54,6 +56,17 @@
       <li>moodycamel readerwriterqueue version: commit 2ae710de996a1d02bbc7696b2cdff2c6078e76f8
       <li>xenium library version: commit f6416d30043a7d025405038d5ddd4794aaaab4a3
     </ul>
+    <h3>AMD Ryzen 9 5950X system</h3>
+    <ul>
+      <li>OS: KDE Neon based on Ubuntu 20.04 and XanMod Kernel 5.10 LTS.
+      <li>Compiler: gcc-9.3.0
+      <li>atomic_queue version: commit e02078c14cab70f0df594ea3406f1240297e11d7
+      <li>Boost version: 1.71.0
+      <li>TBB version: 2019_U7, commit 4233fef583b4f8cbf9f781311717600feaaa0694
+      <li>moodycamel concurrentqueue version: commit dea078cf5b6e742cd67a0d725e36f872feca4de4
+      <li>moodycamel readerwriterqueue version: commit 2ae710de996a1d02bbc7696b2cdff2c6078e76f8
+      <li>xenium library version: commit f6416d30043a7d025405038d5ddd4794aaaab4a3
+    </ul>
     <h3>Source Code</h3>
     <p><a href="https://github.com/max0x7ba/atomic_queue">github.com/max0x7ba/atomic_queue</a></p>
     <p class="copyright">Copyright (c) 2019 Maxim Egorushkin. MIT License. See the full licence in file LICENSE.</p>


=====================================
html/benchmarks.js
=====================================
@@ -159,10 +159,14 @@ $(function() {
 
     const scalability_9900KS = {"AtomicQueue": [[1, 52660493, 286258811, 74231130, 46923128], [2, 11670323, 12511844, 12011858, 270810], [3, 9791407, 10870735, 10354387, 423144], [4, 8124141, 8262334, 8192020, 23767], [5, 7882302, 8164594, 8058345, 45565], [6, 7536832, 7993441, 7709403, 113618], [7, 7011413, 8020563, 7552220, 427030], [8, 6291117, 7515622, 6885968, 545237]], "AtomicQueue2": [[1, 22787102, 61696929, 23153888, 2262406], [2, 11251529, 12267302, 11657086, 212493], [3, 9250720, 10001213, 9472512, 131865], [4, 7958528, 8157226, 8055508, 33266], [5, 7784153, 8097440, 7972636, 61800], [6, 7450035, 7952026, 7641924, 130961], [7, 7005546, 7995642, 7509325, 381599], [8, 6349759, 7441272, 6854003, 471089]], "AtomicQueueB": [[1, 42613077, 228034973, 48968374, 17271281], [2, 11307287, 12122517, 11654762, 192294], [3, 9978460, 11117123, 10580691, 418664], [4, 7820303, 8149391, 8038875, 49723], [5, 7393617, 7922868, 7706848, 116543], [6, 7044646, 7623977, 7432887, 119697], [7, 6771050, 7812016, 7300722, 426304], [8, 6167485, 7214447, 6685564, 449080]], "AtomicQueueB2": [[1, 31747483, 44550020, 34684489, 1949026], [2, 11004660, 11624801, 11264944, 159388], [3, 9311302, 9898647, 9585552, 81750], [4, 7583514, 8026821, 7885529, 68419], [5, 7318917, 7806120, 7600268, 122098], [6, 7004711, 7518179, 7348211, 105453], [7, 6760542, 7775829, 7294366, 408721], [8, 6203358, 7175857, 6682430, 396215]], "OptimistAtomicQueue": [[1, 487380322, 829842979, 661556071, 100346674], [2, 31797501, 32761745, 32437895, 262498], [3, 36537452, 37548890, 37008138, 364848], [4, 39195547, 39453579, 39332552, 57506], [5, 37390896, 48677211, 44454166, 2490283], [6, 41443858, 50559092, 46326029, 3930139], [7, 43825547, 53156863, 48061575, 3621601], [8, 46177415, 50602252, 47828080, 1452954]], "OptimistAtomicQueue2": [[1, 25703634, 682547965, 230538256, 211766068], [2, 21661800, 29516399, 24851671, 1493004], [3, 29291342, 33834235, 30273240, 524342], [4, 32920458, 36241653, 33343018, 441670], [5, 36830993, 43357072, 38976054, 1862089], [6, 39747081, 49741386, 44704047, 4504426], [7, 42479711, 51839802, 46362844, 3648632], [8, 43732450, 49877392, 46347786, 2371894]], "OptimistAtomicQueueB": [[1, 75661057, 738447042, 124305321, 83621261], [2, 31477141, 32474220, 32144227, 176354], [3, 36019269, 37037279, 36563374, 322208], [4, 38357209, 38905937, 38647013, 72549], [5, 36246828, 47608460, 43165102, 2491292], [6, 39494986, 49368578, 44976208, 4044505], [7, 41252863, 51655899, 46076590, 4108616], [8, 43899112, 49215349, 46213653, 1857294]], "OptimistAtomicQueueB2": [[1, 31441458, 495211858, 59246349, 27593701], [2, 21826376, 29825513, 26058597, 2081213], [3, 28756903, 34057706, 29794288, 839909], [4, 31084544, 33672715, 32858135, 485076], [5, 33366524, 40347303, 36955446, 2416293], [6, 36837801, 42786274, 39860539, 2457925], [7, 39946444, 45751323, 42359860, 2112179], [8, 41740252, 46736438, 43950268, 1704291]], "boost::lockfree::queue": [[1, 6746684, 8277185, 7092878, 418709], [2, 7312023, 7803259, 7553075, 87733], [3, 7263517, 7648842, 7476500, 91860], [4, 6359882, 7098293, 6610597, 192715], [5, 6367348, 6773852, 6457372, 46054], [6, 5927503, 6298061, 6055700, 68494], [7, 5746691, 6154693, 5964947, 83543], [8, 5331463, 5801836, 5535251, 89204]], "boost::lockfree::spsc_queue": [[1, 64923339, 78317500, 69086959, 2160846]], "moodycamel::ConcurrentQueue": [[1, 20190901, 29453011, 24985741, 1594915], [2, 14337151, 52431952, 16261043, 4078346], [3, 15291705, 43648056, 17046353, 4143492], [4, 15736506, 45837232, 18228886, 5125409], [5, 16888207, 47841058, 19245549, 5379950], [6, 16998837, 63384866, 20186438, 6382091], [7, 17716036, 66347129, 21038132, 6921929], [8, 17924728, 64375322, 22382013, 8285161]], "moodycamel::ReaderWriterQueue": [[1, 43356419, 538733018, 256503633, 185340411]], "pthread_spinlock": [[1, 23507277, 29932694, 27413691, 1797342], [2, 14270085, 18312194, 16382070, 769144], [3, 8211868, 12289865, 10189163, 1848412], [4, 6395961, 9383867, 7773828, 1275888], [5, 8442872, 10466994, 9009726, 423856], [6, 8112952, 9328919, 8527056, 234738], [7, 7189956, 8492547, 7685023, 190137], [8, 6576974, 7596251, 6917365, 230403]], "std::mutex": [[1, 5006882, 9199394, 6838493, 652022], [2, 4687459, 6598427, 5749404, 387982], [3, 4580302, 6900299, 5685428, 464037], [4, 4941923, 7100935, 6086683, 325998], [5, 5151696, 6739344, 5986755, 186929], [6, 5521016, 6571707, 5918632, 116062], [7, 5532592, 6378700, 5826170, 88618], [8, 5438188, 6181434, 5704761, 76268]], "tbb::concurrent_bounded_queue": [[1, 10925661, 14807665, 13187267, 1088087], [2, 12352037, 15166768, 13521906, 612838], [3, 11099805, 12535211, 11630738, 279433], [4, 9929811, 10656023, 10303443, 177287], [5, 9349138, 10217187, 9704186, 183365], [6, 8548656, 9516659, 8863967, 196987], [7, 7358384, 8693321, 7958661, 218257], [8, 6615544, 8013655, 7136724, 350688]], "tbb::spin_mutex": [[1, 32588344, 41937261, 36432718, 2291145], [2, 17753221, 21806602, 19845873, 1357076], [3, 7201937, 11563566, 9346899, 1335282], [4, 2900531, 6495310, 4753237, 1579671], [5, 5103017, 5929302, 5552236, 189032], [6, 4254932, 5441256, 4834876, 480630], [7, 4223732, 4907625, 4560981, 246626], [8, 3338874, 4286720, 4138009, 129870]], "xenium::michael_scott_queue": [[1, 8417342, 10161353, 9493893, 327033], [2, 8230532, 8706024, 8488596, 76740], [3, 7071683, 7702336, 7404448, 172642], [4, 6177715, 6500382, 6329812, 50090], [5, 6227656, 6844074, 6487028, 190493], [6, 6408222, 7118668, 6666732, 183381], [7, 6220683, 6728490, 6410011, 115700], [8, 5906991, 6324097, 6072896, 89071]], "xenium::ramalhete_queue": [[1, 26889784, 33285933, 31963600, 729718], [2, 22883173, 24719839, 23562698, 341416], [3, 28121330, 29464259, 28838631, 366336], [4, 33312793, 34047588, 33650956, 184508], [5, 31808107, 38717573, 34327553, 2297341], [6, 33560480, 40481895, 36597565, 2593281], [7, 34734954, 42470849, 38204151, 3109357], [8, 35105293, 44944634, 39750343, 4246943]], "xenium::vyukov_bounded_queue": [[1, 60523731, 122827707, 104853037, 23546237], [2, 17367563, 29204433, 25098906, 2910703], [3, 14333973, 16468857, 15718588, 266421], [4, 11678227, 12747022, 12409949, 196985], [5, 10112556, 11532118, 11083680, 290177], [6, 9709516, 12829017, 10969926, 1069776], [7, 9061926, 10421370, 9652587, 457388], [8, 8187699, 8591244, 8371133, 91811]]};
     const scalability_xeon_gold_6132 = {"AtomicQueue": [[1, 8058966, 85486744, 19861417, 13465781], [2, 2774121, 5150399, 3716822, 529166], [3, 2234209, 3581321, 2844019, 297103], [4, 2189691, 2797820, 2500767, 141748], [5, 2000160, 2556556, 2239114, 108475], [6, 1800361, 2193952, 1967523, 85069], [7, 1339017, 2052080, 1747440, 113355], [8, 499239, 1790395, 1251368, 376126], [9, 457147, 1554831, 1065501, 317655], [10, 499701, 1497940, 933685, 296414], [11, 471438, 1317111, 758521, 284702], [12, 472731, 1223669, 645847, 211406], [13, 475966, 1051905, 607384, 154227], [14, 447298, 915959, 542223, 81608]], "AtomicQueue2": [[1, 6014132, 112250995, 11860821, 13520637], [2, 2828684, 4803110, 3861060, 547933], [3, 2370797, 3402752, 2907770, 290882], [4, 2198966, 2893203, 2481239, 168783], [5, 1922906, 2473517, 2215197, 120928], [6, 1700174, 2163119, 1957391, 98690], [7, 1584156, 1904525, 1752509, 71870], [8, 497167, 1692471, 1211725, 399956], [9, 492465, 1637918, 1032783, 355535], [10, 498320, 1502601, 894903, 322686], [11, 496862, 1287595, 740572, 255373], [12, 479471, 1142817, 669465, 220449], [13, 490420, 1087423, 564978, 132699], [14, 484859, 853987, 561566, 95000]], "AtomicQueueB": [[1, 11312440, 21089399, 14319386, 2322974], [2, 2828641, 4395539, 3598695, 363396], [3, 2383683, 3335368, 2837469, 222254], [4, 2194149, 2838158, 2479930, 155470], [5, 1961892, 2545450, 2206488, 124696], [6, 1704523, 2207219, 1965343, 113058], [7, 1400922, 2184936, 1760002, 125320], [8, 498481, 1680613, 1093922, 406887], [9, 495736, 1581164, 956214, 328532], [10, 498850, 1444846, 840343, 308105], [11, 483922, 1277870, 700261, 269404], [12, 487609, 1134736, 616528, 192809], [13, 494557, 857638, 544687, 81207], [14, 483041, 850197, 558294, 95879]], "AtomicQueueB2": [[1, 7460755, 14951085, 10960441, 1884733], [2, 2741293, 4471488, 3421984, 442894], [3, 2351790, 3354557, 2754730, 237182], [4, 2126512, 2763650, 2451035, 148674], [5, 2033646, 2434559, 2185096, 106060], [6, 1749020, 2318698, 1968299, 112029], [7, 1352736, 1922994, 1752021, 107017], [8, 479497, 1649868, 1094885, 411721], [9, 486573, 1566955, 964595, 345537], [10, 498586, 1511963, 858856, 312525], [11, 484384, 1295858, 693007, 252815], [12, 491452, 1155658, 619410, 194677], [13, 442994, 1058050, 576966, 133949], [14, 469414, 882437, 539996, 70095]], "OptimistAtomicQueue": [[1, 56698745, 429583640, 175629468, 86409817], [2, 6408754, 11931110, 8798271, 1427113], [3, 8066359, 13129768, 10458901, 1514753], [4, 8298306, 13581897, 11250748, 1640968], [5, 8932051, 13944639, 12365031, 1196775], [6, 9446462, 14000610, 12900019, 1207077], [7, 9778505, 14314352, 13477473, 850012], [8, 9215134, 11865416, 10467114, 722175], [9, 8102279, 11617885, 10064154, 979170], [10, 7755919, 11379025, 10007986, 1069232], [11, 7809733, 11642631, 10059359, 1147829], [12, 7678745, 11785406, 10015423, 1121277], [13, 7891823, 11650001, 9852053, 1038603], [14, 7931500, 12177433, 9759040, 1154347]], "OptimistAtomicQueue2": [[1, 13352047, 166577270, 79006910, 30513135], [2, 5809820, 10117510, 7296714, 983486], [3, 7359997, 12559722, 9306742, 1644149], [4, 7729367, 12734246, 10474524, 1667974], [5, 8256529, 13316977, 11173176, 1704466], [6, 8427196, 13658790, 12145214, 1423602], [7, 8972407, 13954602, 12800483, 941189], [8, 8306345, 11031293, 10007828, 701969], [9, 7781010, 11330468, 9562517, 884767], [10, 7270803, 10842898, 9535466, 1017074], [11, 7306288, 11400679, 9630510, 1113066], [12, 7615179, 10905131, 9599169, 993126], [13, 7768507, 10951419, 9495167, 927146], [14, 7939789, 11593058, 9363004, 1002168]], "OptimistAtomicQueueB": [[1, 18005087, 461920680, 43299949, 58590278], [2, 7918458, 13244281, 10554149, 1412045], [3, 8566563, 13834992, 11664903, 1605994], [4, 8776970, 13733282, 12143773, 1339924], [5, 9080446, 14486100, 12540476, 1136728], [6, 9031510, 14144692, 12968928, 1144476], [7, 10260978, 14264523, 13401276, 578048], [8, 7860310, 11677713, 10338906, 733228], [9, 8037599, 11536671, 10046625, 980055], [10, 7666387, 11483247, 9974741, 1077884], [11, 7773342, 11518370, 10097099, 1148028], [12, 7708761, 11962418, 10143672, 1169123], [13, 7725882, 11194790, 9873433, 1054815], [14, 7855188, 11275014, 9646028, 1118131]], "OptimistAtomicQueueB2": [[1, 11400233, 27116940, 21484544, 4456865], [2, 6565091, 11622771, 9409379, 1434258], [3, 7435746, 12559877, 10522656, 1516744], [4, 7776622, 12750010, 10260559, 1589501], [5, 7964167, 13270039, 11437117, 1346754], [6, 8849023, 13722187, 11756287, 1234538], [7, 8997751, 13835002, 12188309, 1192711], [8, 7756541, 10713723, 9591582, 747240], [9, 7314675, 11263412, 9209092, 948300], [10, 7352487, 10748888, 9264018, 1017641], [11, 7141749, 10896155, 9260621, 1076754], [12, 7063191, 10471776, 9248261, 984638], [13, 7358863, 10459869, 9071272, 961738], [14, 7490258, 10858481, 8986939, 1056811]], "boost::lockfree::queue": [[1, 1934482, 3335118, 2968513, 267417], [2, 2020556, 2714547, 2380363, 166177], [3, 1766944, 2481333, 2277536, 154223], [4, 1927815, 2468139, 2215008, 117101], [5, 1913080, 2341598, 2154795, 109277], [6, 1737937, 2239840, 2067750, 101330], [7, 1685532, 2158493, 1965928, 102944], [8, 476300, 1588449, 1057234, 312540], [9, 504256, 1466335, 882380, 236710], [10, 495183, 1249404, 733720, 210184], [11, 496163, 1173368, 615041, 163022], [12, 483550, 1080338, 576774, 125017], [13, 479449, 942173, 552191, 90608], [14, 444801, 789696, 538890, 64254]], "boost::lockfree::spsc_queue": [[1, 21589958, 35612264, 26701941, 3432048]], "moodycamel::ConcurrentQueue": [[1, 5031299, 13152497, 7231628, 2054206], [2, 3106244, 21840508, 5669989, 2480503], [3, 4039871, 18242902, 7384110, 3603375], [4, 4487792, 21071736, 8181695, 3838323], [5, 5209580, 24290350, 9672263, 5127482], [6, 5202954, 24160723, 8472347, 4567541], [7, 5415473, 26165080, 9754203, 5527832], [8, 4290069, 18526789, 7646915, 3740996], [9, 4479809, 35353993, 7585632, 6194437], [10, 4727037, 23405328, 7617742, 4615300], [11, 4631325, 30337177, 8709014, 6268210], [12, 4473005, 27300920, 8026322, 5175124], [13, 4555975, 27789293, 8331006, 5575842], [14, 4102221, 43489396, 11921415, 9787758]], "moodycamel::ReaderWriterQueue": [[1, 12713140, 254602528, 122153284, 81114699]], "pthread_spinlock": [[1, 4306958, 8535650, 5905333, 840994], [2, 2839333, 4736775, 4053457, 456568], [3, 2548628, 3614912, 3201805, 248819], [4, 2087992, 2959824, 2605329, 165780], [5, 1983329, 2542321, 2248467, 138984], [6, 1783286, 2276326, 1986022, 112386], [7, 1536216, 2018246, 1766854, 112798], [8, 507415, 1499893, 1072692, 193480], [9, 501385, 1152617, 766700, 218876], [10, 489327, 1025270, 609721, 149499], [11, 497072, 858980, 604787, 120507], [12, 475489, 849693, 593343, 102672], [13, 463691, 888711, 574088, 96224], [14, 373441, 833012, 549424, 69983]], "std::mutex": [[1, 442267, 6858037, 5283864, 1863950], [2, 4162864, 4959039, 4478520, 180618], [3, 2575706, 3420067, 2946085, 152139], [4, 2601420, 3137460, 2858986, 96306], [5, 3392974, 3797099, 3577014, 80921], [6, 4370258, 4891290, 4579916, 108823], [7, 4837222, 6248120, 5845232, 326581], [8, 4675007, 7221265, 6303575, 552163], [9, 4517060, 6675754, 5604113, 611225], [10, 4450885, 6593358, 5396274, 618943], [11, 4666608, 6758794, 5363476, 530564], [12, 4662177, 7071927, 5362666, 566952], [13, 4496056, 7270498, 5446862, 629130], [14, 4471558, 7214091, 5489034, 703952]], "tbb::concurrent_bounded_queue": [[1, 2741938, 6390144, 4991431, 1081767], [2, 3694771, 5634833, 5092675, 420218], [3, 3475746, 4391484, 4044394, 228584], [4, 2964563, 3890751, 3477907, 203006], [5, 2600081, 3341203, 3069347, 157629], [6, 2448135, 3072604, 2752748, 131448], [7, 2331329, 2770486, 2526461, 106497], [8, 1032645, 2367531, 1609048, 398019], [9, 768399, 2133918, 1378943, 297095], [10, 886747, 1960986, 1287592, 241557], [11, 852994, 1572988, 1213625, 141077], [12, 905349, 1536817, 1207538, 119201], [13, 672137, 1425158, 1150131, 125239], [14, 568180, 1255046, 1002357, 146505]], "tbb::spin_mutex": [[1, 21210988, 25406844, 23208893, 942349], [2, 7466066, 15461111, 13086723, 1647857], [3, 6548025, 10474300, 8916823, 708177], [4, 3503017, 7794311, 6294651, 966794], [5, 2153878, 5637630, 4544841, 631651], [6, 1922531, 4200007, 3254751, 437747], [7, 1534161, 2793915, 2246670, 284381], [8, 767030, 1603044, 1236223, 188171], [9, 664685, 1136499, 875213, 112513], [10, 503884, 920905, 710065, 93160], [11, 429966, 825839, 612632, 95126], [12, 328981, 741818, 536929, 89893], [13, 360477, 620612, 498964, 64207], [14, 343378, 562153, 446904, 49826]], "xenium::michael_scott_queue": [[1, 1770874, 4922580, 3393287, 798045], [2, 1987279, 3672290, 2760207, 374957], [3, 2000056, 2824672, 2385886, 152176], [4, 1827185, 2416437, 2127391, 115719], [5, 1702595, 2145286, 1919895, 91485], [6, 1536137, 1930985, 1748041, 79961], [7, 1426820, 1834610, 1643576, 81903], [8, 498697, 1628919, 1118063, 276128], [9, 452869, 1380436, 834411, 255185], [10, 494632, 1118414, 682696, 203418], [11, 490195, 1028229, 585071, 155611], [12, 484824, 889727, 574498, 120673], [13, 497397, 848913, 548659, 87463], [14, 498987, 845423, 541580, 77173]], "xenium::ramalhete_queue": [[1, 3243963, 16649455, 9804049, 4323515], [2, 4857860, 10891091, 6531145, 1101794], [3, 5681860, 10963393, 7152903, 886425], [4, 6453166, 11687397, 8090624, 1227694], [5, 7515932, 11465916, 8472107, 1003833], [6, 7603204, 11843149, 8816720, 1186933], [7, 7778687, 11444208, 8969099, 1200481], [8, 6620873, 8934784, 7893553, 554709], [9, 7110063, 8505487, 7938195, 307016], [10, 7332561, 8873905, 8083197, 302364], [11, 7650290, 8835820, 8195968, 282168], [12, 7663185, 8824693, 8282478, 271141], [13, 7786817, 9767663, 8710633, 459364], [14, 7888409, 11483491, 9499927, 1182102]], "xenium::vyukov_bounded_queue": [[1, 6620293, 58918128, 36338730, 16662346], [2, 3698951, 10319122, 6978079, 1806086], [3, 3321190, 5064399, 4427496, 329624], [4, 3526724, 4346643, 3923541, 164522], [5, 3316072, 3924131, 3551537, 117605], [6, 3114542, 3481877, 3279592, 91098], [7, 2784557, 3242623, 3020950, 108825], [8, 1278721, 2800348, 1844408, 521532], [9, 1103213, 2357968, 1486304, 324785], [10, 1025767, 1973106, 1342701, 256232], [11, 732921, 1613235, 1194292, 156458], [12, 494928, 1408766, 1053087, 242590], [13, 479926, 1216268, 994219, 184954], [14, 433322, 1122701, 804412, 232255]]};
+    const scalability_ryzen_5950x = {"AtomicQueue": [[1, 21295543, 35842740, 28172806, 2479430], [2, 3394180, 3469545, 3429817, 31948], [3, 2490960, 2650028, 2569420, 72586], [4, 1958844, 2071203, 2015194, 50782], [5, 959794, 1321468, 1126614, 166128], [6, 869656, 1175329, 1000005, 125300], [7, 855015, 965053, 908419, 36067], [8, 844334, 912315, 876586, 28265], [9, 809251, 897138, 861923, 22639], [10, 814346, 915698, 850386, 28166], [11, 815696, 868686, 838888, 17771], [12, 806778, 841887, 821050, 9212], [13, 764646, 873229, 809823, 38277], [14, 729665, 855147, 788284, 51654], [15, 695598, 835945, 756640, 58734], [16, 661065, 791738, 725248, 63022]], "AtomicQueue2": [[1, 13741574, 17195880, 15113722, 898672], [2, 3381441, 3471028, 3421654, 33824], [3, 2475969, 2634066, 2551893, 70606], [4, 1953014, 2063644, 2007001, 49925], [5, 943112, 1294239, 1103442, 160861], [6, 853470, 1164837, 987698, 137147], [7, 835922, 965368, 893078, 54994], [8, 844750, 886186, 857632, 10032], [9, 801647, 888990, 848813, 30479], [10, 803405, 879079, 839813, 30698], [11, 823949, 865885, 842995, 14384], [12, 816404, 861072, 825843, 8589], [13, 767201, 872807, 810309, 30929], [14, 735623, 850997, 789084, 45640], [15, 699825, 835390, 759058, 56215], [16, 661971, 790639, 725334, 61434]], "AtomicQueueB": [[1, 14989926, 23658435, 17992206, 2005217], [2, 3373949, 3431118, 3403367, 23733], [3, 2472153, 2638609, 2553529, 77513], [4, 1944419, 2067157, 2004659, 55955], [5, 951805, 1296560, 1105857, 156017], [6, 870340, 1162566, 993857, 122141], [7, 855897, 953367, 907695, 31505], [8, 841758, 907218, 872646, 27313], [9, 812440, 888656, 862920, 17825], [10, 820732, 882242, 851002, 23411], [11, 805128, 863252, 830031, 23033], [12, 816971, 850702, 824932, 6673], [13, 777096, 870856, 815340, 29018], [14, 748360, 851750, 794741, 42345], [15, 715862, 831582, 767599, 50018], [16, 690548, 789919, 739527, 47887]], "AtomicQueueB2": [[1, 15498703, 24531125, 17630225, 3208077], [2, 3383522, 3452964, 3420211, 28460], [3, 2464641, 2630256, 2545318, 77418], [4, 1937012, 2061155, 1998631, 58068], [5, 946180, 1301124, 1108917, 163042], [6, 866737, 1168507, 992803, 129307], [7, 853516, 960067, 900516, 45029], [8, 841111, 889749, 865698, 21556], [9, 818644, 882937, 854443, 19498], [10, 809528, 879137, 842534, 27852], [11, 809393, 864336, 832605, 20330], [12, 817922, 871669, 832346, 8592], [13, 791483, 859286, 822050, 18530], [14, 759673, 850982, 801021, 35280], [15, 723614, 834150, 771812, 45975], [16, 694540, 792854, 742429, 46964]], "OptimistAtomicQueue": [[1, 341389907, 602527240, 431387408, 54886177], [2, 13658253, 14614962, 13949143, 201327], [3, 16319281, 17757417, 17054184, 645787], [4, 16148553, 18212036, 17179994, 974951], [5, 9894838, 12210197, 10472612, 609243], [6, 10356881, 10735298, 10498062, 111092], [7, 11017236, 11645993, 11314419, 248835], [8, 11786496, 16693227, 13944166, 2140883], [9, 11942489, 13140510, 12475175, 455537], [10, 12120525, 14400357, 12993033, 854450], [11, 12648815, 15865295, 13838569, 1169719], [12, 12421828, 17662658, 14233404, 1777116], [13, 12956135, 17792566, 14506748, 1511164], [14, 13234379, 16612985, 14786609, 1504615], [15, 13404066, 17334728, 15272480, 1839210], [16, 13504328, 18321377, 15854345, 2330212]], "OptimistAtomicQueue2": [[1, 31960034, 49261316, 33040287, 2321274], [2, 12799633, 13213681, 13007056, 140064], [3, 15100651, 16045366, 15585577, 343314], [4, 13614811, 16242316, 14843225, 1132210], [5, 8366155, 8835665, 8669958, 150651], [6, 9158774, 9872443, 9468583, 254072], [7, 9595378, 10934328, 10264693, 593720], [8, 11230442, 12794788, 11602139, 344962], [9, 10612974, 12375119, 11430411, 772028], [10, 11410749, 13288461, 12242493, 793520], [11, 12387424, 14844253, 13305768, 869435], [12, 12178191, 15481166, 13210012, 1036054], [13, 12418970, 15999603, 13507395, 1068528], [14, 12393032, 15754443, 13833432, 1390840], [15, 12505339, 16395039, 14365960, 1823382], [16, 12644793, 17221525, 14814177, 2139400]], "OptimistAtomicQueueB": [[1, 193339455, 320812451, 228051227, 40791027], [2, 13810661, 15092576, 14109785, 314653], [3, 16250475, 17769573, 17019086, 689761], [4, 16017464, 18302827, 17159665, 1096356], [5, 9872996, 11366391, 10376422, 502319], [6, 10353096, 10805529, 10539297, 162907], [7, 10996126, 11788483, 11362136, 306538], [8, 11920386, 16987547, 14152970, 2166020], [9, 11988500, 13283407, 12530977, 479361], [10, 12176298, 14105969, 12993058, 784412], [11, 12668042, 15634003, 13773366, 1058175], [12, 12422798, 16930548, 14206839, 1748461], [13, 12977710, 17091121, 14554113, 1545085], [14, 13341569, 17588355, 15089321, 1715757], [15, 13512972, 17828656, 15607935, 2054751], [16, 13639536, 18659398, 16087331, 2421507]], "OptimistAtomicQueueB2": [[1, 47683902, 50193979, 48491157, 486231], [2, 12921392, 13307473, 13116503, 145565], [3, 14597155, 16224783, 15446962, 717840], [4, 13573261, 16437085, 14919440, 1278663], [5, 8238326, 8720676, 8528381, 174136], [6, 9101014, 9938667, 9437470, 308194], [7, 9508249, 10870736, 10185328, 600649], [8, 11118015, 12507639, 11482125, 348372], [9, 10629493, 12234906, 11385874, 700054], [10, 11392711, 13153599, 12181063, 757937], [11, 12340067, 14362440, 13152426, 776840], [12, 12280642, 15962685, 13624433, 1334359], [13, 12395574, 15947344, 13760740, 1338907], [14, 12425126, 16042384, 14065211, 1609272], [15, 12556442, 16805575, 14575409, 1974290], [16, 12689671, 17509368, 15028324, 2290207]], "boost::lockfree::queue": [[1, 2476768, 2578307, 2503077, 16146], [2, 1764933, 1793899, 1778281, 7907], [3, 1452498, 1540432, 1489512, 32216], [4, 1289983, 1320360, 1304907, 11257], [5, 794082, 885520, 834379, 32180], [6, 784462, 872385, 823576, 22372], [7, 416269, 866025, 631022, 209631], [8, 345719, 789266, 559187, 215472], [9, 412693, 600916, 509010, 83014], [10, 455346, 614859, 539671, 61639], [11, 482268, 605688, 550803, 31603], [12, 488322, 590606, 541703, 31476], [13, 490772, 555296, 516438, 15719], [14, 482188, 528380, 499080, 10088], [15, 462991, 480529, 470421, 3138], [16, 430559, 457354, 441835, 8790]], "boost::lockfree::spsc_queue": [[1, 27550404, 37754826, 34917096, 2778590]], "moodycamel::ConcurrentQueue": [[1, 4348326, 5145652, 4486582, 117288], [2, 4125791, 8552994, 4625689, 1157979], [3, 4740871, 9154007, 5234179, 1086936], [4, 5316360, 14791421, 6209350, 1734265], [5, 3358216, 16406122, 5960866, 2699185], [6, 3619221, 15491041, 5178497, 2464331], [7, 4005591, 19010685, 5995624, 2843800], [8, 4140544, 16920564, 5792536, 2643294], [9, 4091094, 20905155, 5607134, 3082470], [10, 4291133, 24730378, 5891180, 3204591], [11, 4387165, 17283594, 5748309, 2475644], [12, 4421958, 26077368, 5694981, 3123088], [13, 4509866, 22863671, 6270463, 3959906], [14, 4589085, 29264650, 6461633, 4793550], [15, 4630216, 27186852, 6477999, 4394472], [16, 4631448, 29668126, 6301973, 4224746]], "moodycamel::ReaderWriterQueue": [[1, 10345494, 271338758, 30878566, 32277140]], "pthread_spinlock": [[1, 4619756, 5117377, 4716207, 91856], [2, 2070835, 3034473, 2469041, 166182], [3, 1665854, 2391068, 2138608, 182368], [4, 253013, 1815428, 1033847, 632107], [5, 780890, 1478238, 1114289, 292954], [6, 763786, 1158471, 946051, 166469], [7, 831271, 901787, 870529, 18553], [8, 794907, 913088, 856103, 48738], [9, 766231, 871972, 840333, 18588], [10, 702292, 860919, 791159, 41583], [11, 644438, 819517, 745228, 47786], [12, 576335, 764183, 721761, 51020], [13, 581230, 765015, 697292, 51708], [14, 576006, 707635, 646152, 40113], [15, 537165, 616377, 578816, 18093], [16, 484658, 569050, 522612, 14623]], "std::mutex": [[1, 1030724, 2794303, 1769715, 592242], [2, 2872751, 3101101, 2979788, 49573], [3, 2058240, 2528068, 2151124, 81022], [4, 2079950, 2399277, 2145246, 54704], [5, 1006844, 1248402, 1072375, 36656], [6, 866281, 1116492, 937202, 41734], [7, 815880, 1089136, 907324, 57254], [8, 808443, 1134573, 921787, 81834], [9, 815507, 987125, 871383, 28846], [10, 810619, 917804, 843131, 17107], [11, 803806, 914404, 837592, 19204], [12, 811334, 908695, 845070, 17766], [13, 790324, 871971, 816022, 13983], [14, 775684, 844939, 796763, 11494], [15, 763740, 821326, 781607, 10176], [16, 750030, 806035, 771454, 9235]], "tbb::concurrent_bounded_queue": [[1, 2953202, 3854497, 3433498, 87332], [2, 3616439, 4018613, 3938994, 65277], [3, 2430449, 2519805, 2491612, 23967], [4, 2033947, 2078719, 2055753, 19612], [5, 1023855, 1109947, 1048028, 28041], [6, 890014, 1079888, 957052, 66613], [7, 841605, 972391, 881371, 37058], [8, 823983, 922690, 872088, 46797], [9, 820321, 868417, 833919, 9042], [10, 822001, 882898, 837252, 12251], [11, 807773, 841548, 815495, 6617], [12, 792136, 840341, 818179, 13891], [13, 777670, 810566, 790222, 6504], [14, 738670, 793129, 763006, 20175], [15, 704751, 769505, 735903, 29394], [16, 681614, 749735, 715320, 32827]], "tbb::spin_mutex": [[1, 13303338, 14029398, 13686140, 155000], [2, 5333560, 5970925, 5580405, 119385], [3, 3606876, 3839295, 3688735, 47090], [4, 3085486, 3271458, 3167074, 39386], [5, 1573380, 2057170, 1790334, 180012], [6, 1447557, 1664776, 1541561, 61537], [7, 1287956, 1480278, 1339968, 33728], [8, 1227257, 1406359, 1290200, 41626], [9, 1284532, 1412123, 1360067, 24278], [10, 1150930, 1396416, 1318055, 58110], [11, 1088297, 1302474, 1201405, 50038], [12, 933730, 1048920, 971454, 27315], [13, 986239, 1130819, 1033081, 25392], [14, 955548, 1139028, 1037207, 37897], [15, 887563, 1020685, 958823, 23060], [16, 825635, 918252, 860462, 19686]], "xenium::michael_scott_queue": [[1, 3309205, 3474663, 3386276, 34038], [2, 2939859, 3097449, 3026075, 59730], [3, 2182347, 2260268, 2219558, 19901], [4, 1747719, 1787606, 1767293, 9477], [5, 1062719, 1367870, 1173337, 113551], [6, 981986, 1161172, 1048359, 54987], [7, 939234, 1018805, 971332, 23650], [8, 774566, 889174, 830525, 49362], [9, 867727, 917999, 891369, 15851], [10, 869390, 924190, 891855, 14970], [11, 831869, 902709, 861005, 21628], [12, 767728, 863786, 809430, 34192], [13, 746657, 847725, 795403, 39397], [14, 715075, 824983, 772419, 43997], [15, 676553, 805652, 737369, 52001], [16, 628572, 740667, 687693, 50360]], "xenium::ramalhete_queue": [[1, 4042746, 4646301, 4303546, 139605], [2, 7565053, 9792901, 8819711, 641889], [3, 10561308, 12152128, 11701045, 392608], [4, 13117708, 14858321, 14462221, 282769], [5, 7623394, 8304795, 7870542, 157566], [6, 8570963, 8874821, 8740212, 54124], [7, 9463588, 10809493, 10035877, 504461], [8, 9980896, 14838853, 12373227, 2306465], [9, 9811109, 11433399, 10683409, 605592], [10, 9140696, 10710778, 10278780, 380932], [11, 9649405, 11154997, 10284158, 492901], [12, 9996820, 12086850, 10722357, 576643], [13, 10483396, 12062364, 10893390, 295764], [14, 10880710, 12142606, 11184796, 222352], [15, 11233547, 11713937, 11448521, 144645], [16, 11354170, 11964172, 11803898, 101828]], "xenium::vyukov_bounded_queue": [[1, 11639244, 92175617, 30578122, 21038427], [2, 4495006, 5852154, 5544747, 178825], [3, 3201919, 3760923, 3493329, 211310], [4, 3031056, 3701524, 3418315, 248777], [5, 1975489, 3137414, 2520679, 536231], [6, 1931764, 2644079, 2250631, 293724], [7, 1909656, 2199846, 2066973, 112186], [8, 1982604, 2380313, 2131389, 146327], [9, 1900776, 2064193, 1987146, 54495], [10, 1935005, 2096700, 2023293, 55435], [11, 1920842, 2233286, 2053693, 70996], [12, 1969133, 2167953, 2073549, 63446], [13, 1950805, 2169376, 2052178, 68364], [14, 1934051, 2160168, 2037191, 82253], [15, 1915321, 2100003, 2005809, 76568], [16, 1894059, 2075978, 1987443, 75691]]};
     const latency_9900KS = {"AtomicQueue": [157, 171, 166, 0], "AtomicQueue2": [173, 177, 175, 0], "AtomicQueueB": [171, 184, 179, 3], "AtomicQueueB2": [175, 192, 180, 3], "OptimistAtomicQueue": [148, 160, 153, 3], "OptimistAtomicQueue2": [167, 176, 173, 1], "OptimistAtomicQueueB": [140, 154, 141, 1], "OptimistAtomicQueueB2": [149, 155, 150, 1], "boost::lockfree::queue": [310, 338, 319, 4], "boost::lockfree::spsc_queue": [129, 135, 132, 0], "moodycamel::ConcurrentQueue": [208, 254, 231, 7], "moodycamel::ReaderWriterQueue": [110, 167, 137, 12], "pthread_spinlock": [226, 308, 279, 25], "std::mutex": [411, 525, 465, 20], "tbb::concurrent_bounded_queue": [268, 307, 287, 9], "tbb::spin_mutex": [246, 309, 275, 18], "xenium::michael_scott_queue": [357, 407, 371, 6], "xenium::ramalhete_queue": [255, 282, 267, 4], "xenium::vyukov_bounded_queue": [183, 227, 212, 11]};
     const latency_xeon_gold_6132 = {"AtomicQueue": [231, 479, 321, 72], "AtomicQueue2": [307, 556, 394, 86], "AtomicQueueB": [344, 588, 423, 80], "AtomicQueueB2": [403, 711, 491, 111], "OptimistAtomicQueue": [283, 459, 346, 55], "OptimistAtomicQueue2": [315, 562, 392, 78], "OptimistAtomicQueueB": [321, 507, 378, 69], "OptimistAtomicQueueB2": [345, 572, 409, 84], "boost::lockfree::queue": [726, 1151, 869, 154], "boost::lockfree::spsc_queue": [269, 507, 356, 69], "moodycamel::ConcurrentQueue": [427, 789, 547, 120], "moodycamel::ReaderWriterQueue": [207, 552, 328, 94], "pthread_spinlock": [623, 1899, 946, 308], "std::mutex": [1859, 3202, 2340, 463], "tbb::concurrent_bounded_queue": [565, 993, 683, 155], "tbb::spin_mutex": [561, 1069, 741, 156], "xenium::michael_scott_queue": [733, 1255, 879, 196], "xenium::ramalhete_queue": [493, 887, 596, 139], "xenium::vyukov_bounded_queue": [436, 685, 521, 89]};
-    plot_scalability('scalability-9900KS-5GHz', scalability_9900KS, "Intel i9-9900KS (core 5GHz / uncore 4.7GHz)", 60e6, 1000e6);
-    plot_scalability('scalability-xeon-gold-6132', scalability_xeon_gold_6132, "Intel Xeon Gold 6132 (stock)", 15e6, 300e6);
-    plot_latency('latency-9900KS-5GHz', latency_9900KS, "Intel i9-9900KS (core 5GHz / uncore 4.7GHz)");
-    plot_latency('latency-xeon-gold-6132', latency_xeon_gold_6132, "Intel Xeon Gold 6132 (stock)");
+    const latency_ryzen_5950x = {"AtomicQueue": [353, 370, 365, 4], "AtomicQueue2": [375, 396, 386, 4], "AtomicQueueB": [365, 371, 368, 1], "AtomicQueueB2": [380, 387, 381, 1], "OptimistAtomicQueue": [342, 346, 343, 0], "OptimistAtomicQueue2": [296, 321, 309, 6], "OptimistAtomicQueueB": [318, 327, 325, 2], "OptimistAtomicQueueB2": [337, 353, 345, 3], "boost::lockfree::queue": [741, 747, 743, 1], "boost::lockfree::spsc_queue": [403, 405, 404, 0], "moodycamel::ConcurrentQueue": [539, 623, 587, 18], "moodycamel::ReaderWriterQueue": [355, 415, 374, 16], "pthread_spinlock": [737, 747, 742, 1], "std::mutex": [1462, 1624, 1513, 22], "tbb::concurrent_bounded_queue": [971, 1000, 974, 3], "tbb::spin_mutex": [638, 646, 643, 1], "xenium::michael_scott_queue": [940, 1061, 994, 26], "xenium::ramalhete_queue": [607, 659, 629, 11], "xenium::vyukov_bounded_queue": [469, 521, 476, 7]};
+    plot_scalability('scalability-9900KS-5GHz', scalability_9900KS, "Intel i9-9900KS", 60e6, 1000e6);
+    plot_scalability('scalability-xeon-gold-6132', scalability_xeon_gold_6132, "Intel Xeon Gold 6132", 15e6, 300e6);
+    plot_scalability('scalability-ryzen-5950x', scalability_ryzen_5950x, "AMD Ryzen 9 5950X", 20e6, 500e6);
+    plot_latency('latency-9900KS-5GHz', latency_9900KS, "Intel i9-9900KS");
+    plot_latency('latency-xeon-gold-6132', latency_xeon_gold_6132, "Intel Xeon Gold 6132");
+    plot_latency('latency-ryzen-5950x', latency_ryzen_5950x, "AMD Ryzen 9 5950X");
 });


=====================================
include/atomic_queue/atomic_queue.h
=====================================
@@ -29,12 +29,14 @@ namespace details {
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
 template<size_t elements_per_cache_line> struct GetCacheLineIndexBits { static int constexpr value = 0; };
-template<> struct GetCacheLineIndexBits<64> { static int constexpr value = 6; };
-template<> struct GetCacheLineIndexBits<32> { static int constexpr value = 5; };
-template<> struct GetCacheLineIndexBits<16> { static int constexpr value = 4; };
-template<> struct GetCacheLineIndexBits< 8> { static int constexpr value = 3; };
-template<> struct GetCacheLineIndexBits< 4> { static int constexpr value = 2; };
-template<> struct GetCacheLineIndexBits< 2> { static int constexpr value = 1; };
+template<> struct GetCacheLineIndexBits<256> { static int constexpr value = 8; };
+template<> struct GetCacheLineIndexBits<128> { static int constexpr value = 7; };
+template<> struct GetCacheLineIndexBits< 64> { static int constexpr value = 6; };
+template<> struct GetCacheLineIndexBits< 32> { static int constexpr value = 5; };
+template<> struct GetCacheLineIndexBits< 16> { static int constexpr value = 4; };
+template<> struct GetCacheLineIndexBits<  8> { static int constexpr value = 3; };
+template<> struct GetCacheLineIndexBits<  4> { static int constexpr value = 2; };
+template<> struct GetCacheLineIndexBits<  2> { static int constexpr value = 1; };
 
 template<bool minimize_contention, unsigned array_size, size_t elements_per_cache_line>
 struct GetIndexShuffleBits {
@@ -76,8 +78,8 @@ constexpr T& map(T* elements, unsigned index) noexcept {
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-// Implement a "bit-twiddling hack" for finding the next power of 2
-// in either 32 bits or 64 bits in C++11 compatible constexpr functions
+// Implement a "bit-twiddling hack" for finding the next power of 2 in either 32 bits or 64 bits
+// in C++11 compatible constexpr functions. The library no longer maintains C++11 compatibility.
 
 // "Runtime" version for 32 bits
 // --a;
@@ -89,22 +91,22 @@ constexpr T& map(T* elements, unsigned index) noexcept {
 // ++a;
 
 template<class T>
-constexpr T decrement(T x) {
+constexpr T decrement(T x) noexcept {
     return x - 1;
 }
 
 template<class T>
-constexpr T increment(T x) {
+constexpr T increment(T x) noexcept {
     return x + 1;
 }
 
 template<class T>
-constexpr T or_equal(T x, unsigned u) {
-    return (x | x >> u);
+constexpr T or_equal(T x, unsigned u) noexcept {
+    return x | x >> u;
 }
 
 template<class T, class... Args>
-constexpr T or_equal(T x, unsigned u, Args... rest) {
+constexpr T or_equal(T x, unsigned u, Args... rest) noexcept {
     return or_equal(or_equal(x, u), rest...);
 }
 


=====================================
include/atomic_queue/defs.h
=====================================
@@ -6,8 +6,7 @@
 
 #include <atomic>
 
-#if defined(__x86_64__) || defined(_M_X64) || \
-    defined(__i386__) || defined(_M_IX86)
+#if defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || defined(_M_IX86)
 #include <emmintrin.h>
 namespace atomic_queue {
 constexpr int CACHE_LINE_SIZE = 64;
@@ -36,8 +35,24 @@ static inline void spin_loop_pause() noexcept {
 #endif
 }
 } // namespace atomic_queue
+#elif defined(__ppc64__) || defined(__powerpc64__)
+namespace atomic_queue {
+constexpr int CACHE_LINE_SIZE = 128; // TODO: Review that this is the correct value.
+static inline void spin_loop_pause() noexcept {
+    asm volatile("or 31,31,31 # very low priority"); // TODO: Review and benchmark that this is the right instruction.
+}
+} // namespace atomic_queue
+#elif defined(__s390x__)
+namespace atomic_queue {
+constexpr int CACHE_LINE_SIZE = 256; // TODO: Review that this is the correct value.
+static inline void spin_loop_pause() noexcept {} // TODO: Find the right instruction to use here, if any.
+} // namespace atomic_queue
 #else
-#error "Unknown CPU architecture."
+#warning "Unknown CPU architecture. Using L1 cache line size of 64 bytes and no spinloop pause instruction."
+namespace atomic_queue {
+constexpr int CACHE_LINE_SIZE = 64; // TODO: Review that this is the correct value.
+static inline void spin_loop_pause() noexcept {}
+} // namespace atomic_queue
 #endif
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


=====================================
meson.build
=====================================
@@ -9,12 +9,14 @@ project(
 )
 
 cxx = meson.get_compiler('cpp')
-tbb = cxx.find_library('tbb', required : true)
 dl = cxx.find_library('dl', required : true)
 threads = dependency('threads')
 unit_test_framework = dependency('boost', modules : ['unit_test_framework'])
-xenium = declare_dependency(include_directories : '../xenium')
-moodycamel = declare_dependency(include_directories : '../')
+if get_option('benchmarks')
+  tbb = cxx.find_library('tbb', required : true)
+  xenium = declare_dependency(include_directories : '../xenium')
+  moodycamel = declare_dependency(include_directories : '../')
+endif
 
 atomic_queue = declare_dependency(include_directories : ['include'], dependencies : threads)
 
@@ -31,8 +33,10 @@ example_exe = executable(
   dependencies : [atomic_queue]
 )
 
-benchmarks_exe = executable(
-  'benchmarks',
-  ['src/benchmarks.cc', 'src/cpu_base_frequency.cc', 'src/huge_pages.cc'],
-  dependencies : [atomic_queue, xenium, moodycamel, tbb, dl]
-)
+if get_option('benchmarks')
+  benchmarks_exe = executable(
+    'benchmarks',
+    ['src/benchmarks.cc', 'src/cpu_base_frequency.cc', 'src/huge_pages.cc'],
+    dependencies : [atomic_queue, xenium, moodycamel, tbb, dl]
+  )
+endif


=====================================
meson_options.txt
=====================================
@@ -0,0 +1,2 @@
+option('benchmarks', type : 'boolean', value : true,
+       description : 'Do not build benchmarks; ignore their dependencies')


=====================================
results/results-16.20191220T000148.txt deleted
=====================================
The diff for this file was not included because it is too large.

=====================================
results/results-16.20200119T235604.txt deleted
=====================================
The diff for this file was not included because it is too large.

=====================================
results/results-28.20191221T010636.txt deleted
=====================================
The diff for this file was not included because it is too large.

=====================================
results/results-28.20200126T222915.txt deleted
=====================================
The diff for this file was not included because it is too large.

=====================================
results/results-32.20210418T004017.txt
=====================================
The diff for this file was not included because it is too large.

=====================================
results/results-8.20191005T041115.txt deleted
=====================================
The diff for this file was not included because it is too large.

=====================================
scripts/benchmark-epilogue.sh
=====================================
@@ -3,6 +3,5 @@
 set +e # Ignore failures.
 
 sudo cpupower frequency-set --related --governor powersave >/dev/null
-~/scripts/cpu-fans.sh 3 >/dev/null
 
 [[ -f .sched_rt_runtime_us.txt ]] && sudo tee /proc/sys/kernel/sched_rt_runtime_us >/dev/null <.sched_rt_runtime_us.txt


=====================================
scripts/benchmark-prologue.sh
=====================================
@@ -4,7 +4,6 @@ set +e # Ignore failures.
 
 sudo hugeadm --pool-pages-min 1GB:1 --pool-pages-max 1GB:1
 sudo cpupower frequency-set --related --governor performance >/dev/null
-~/scripts/cpu-fans.sh 5 >/dev/null
 
 if [[ -e /proc/sys/kernel/sched_rt_runtime_us ]]; then
     if [[ ! -e .sched_rt_runtime_us.txt ]]; then


=====================================
scripts/plot_scalability.py deleted
=====================================
@@ -1,64 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (c) 2019 Maxim Egorushkin. MIT License. See the full licence in file LICENSE.
-
-import sys
-import math
-import numpy as np
-import pandas as pd
-from scipy import stats
-from pprint import pprint
-
-import matplotlib.pyplot as plt
-import matplotlib
-from matplotlib.ticker import MultipleLocator, FuncFormatter
-
-from matplotlib import rcParams
-rcParams['font.family'] = 'serif'
-rcParams['font.serif'] = ['Ubuntu']
-
-from parse_output import *
-
-# print("numpy", np.__version__)
-# print("pandas", pd.__version__)
-# print("matplotlib", matplotlib.__version__)
-
-results = list(parse_output(sys.stdin))
-# pprint(results)
-
-def plot_scalability(results):
-    df = as_scalability_df(results)
-    # print(df.to_json(orient='columns'))
-    # print(df.columns)
-
-    style = {
-        'pthread_spinlock': 's-',
-        'boost::lockfree::queue': 's-',
-
-        'tbb::concurrent_bounded_queue': 's-',
-        'tbb::spin_mutex': 's-',
-        'tbb::speculative_spin_mutex': 's-',
-
-        'AtomicQueue': 'x-r',
-        'AtomicQueue2': 'x-y',
-
-        'BlockingAtomicQueue': 'o-r',
-        'BlockingAtomicQueue2': 'o-y',
-        }
-    ax = df.plot(title='Scalability, Intel Xeon Gold 6132', style=style)
-    # ax = df.plot(title='Scalability, Intel Core i7-7700K 5GHz', style=style)
-    ax.autoscale(tight=False)
-    ax.legend(frameon=False)
-    ax.get_yaxis().set_major_formatter(FuncFormatter(lambda x, p: format(int(x), ',')))
-    ax.set_ylabel('msg/sec')
-    ax.set_ylim(top=12e7, bottom=-1e6)
-    # ax.yaxis.set_major_locator(MultipleLocator(1e9))
-    ax.set_xlabel('number of producers, number of consumers')
-    ax.yaxis.set_major_locator(MultipleLocator(1e7))
-    ax.xaxis.set_major_locator(MultipleLocator(1))
-    ax.set_frame_on(False)
-    ax.grid()
-    plt.show()
-
-
-plot_scalability(results)


=====================================
src/tests.cc
=====================================
@@ -64,7 +64,7 @@ void stress() {
 
     uint64_t result = 0;
     for(auto& r : results) {
-        BOOST_CHECK_GT(r, (expected_result / CONSUMERS) / 10); // Make sure a consumer didn't starve. False positives are possible here.
+        BOOST_WARN_GT(r, (expected_result / CONSUMERS) / 10); // Make sure a consumer didn't starve. False positives are possible here.
         result += r;
     }
 
@@ -105,7 +105,6 @@ void test_unique_ptr_int(Q& q) {
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-
 } // namespace
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -157,7 +156,7 @@ BOOST_AUTO_TEST_CASE(try_push) {
       /* SPSC = */ true
       >;
 
-    constexpr unsigned CAPACITY = 4096;
+    constexpr unsigned CAPACITY = CACHE_LINE_SIZE * CACHE_LINE_SIZE;
     Queue q(CAPACITY);
     BOOST_CHECK_EQUAL(q.capacity(), CAPACITY);
     BOOST_CHECK(q.was_empty());
@@ -176,4 +175,23 @@ BOOST_AUTO_TEST_CASE(try_push) {
     BOOST_CHECK_EQUAL(q.was_size(), CAPACITY);
 }
 
+BOOST_AUTO_TEST_CASE(size) {
+    atomic_queue::RetryDecorator<atomic_queue::AtomicQueueB2<float>> q(10);
+    BOOST_CHECK_EQUAL(q.capacity(), CACHE_LINE_SIZE * CACHE_LINE_SIZE);
+}
+
+BOOST_AUTO_TEST_CASE(power_of_2) {
+    using atomic_queue::details::round_up_to_power_of_2;
+    static_assert(round_up_to_power_of_2(0u) == 0u, "");
+    static_assert(round_up_to_power_of_2(1u) == 1u, "");
+    static_assert(round_up_to_power_of_2(2u) == 2u, "");
+    static_assert(round_up_to_power_of_2(3u) == 4u, "");
+    static_assert(round_up_to_power_of_2(127u) == 128u, "");
+    static_assert(round_up_to_power_of_2(128u) == 128u, "");
+    static_assert(round_up_to_power_of_2(129u) == 256u, "");
+    static_assert(round_up_to_power_of_2(0x40000000u - 1) == 0x40000000u, "");
+    static_assert(round_up_to_power_of_2(0x40000000u    ) == 0x40000000u, "");
+    static_assert(round_up_to_power_of_2(0x40000000u + 1) == 0x80000000u, "");
+}
+
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



View it on GitLab: https://salsa.debian.org/med-team/libatomic-queue/-/compare/24e2f2dd0a592dd255878b8ee7754c7dc23570cf...017186ccf12d11bd9c1b29fe29ab2299edfad0d3

-- 
View it on GitLab: https://salsa.debian.org/med-team/libatomic-queue/-/compare/24e2f2dd0a592dd255878b8ee7754c7dc23570cf...017186ccf12d11bd9c1b29fe29ab2299edfad0d3
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20211221/a94141df/attachment-0001.htm>


More information about the debian-med-commit mailing list