background
Scenario distributed system's read-write mode, the presence of a plurality of users (volume) written simultaneously. For a single disc, it is there may be multiple threads simultaneously read and write the scene. The traditional approach can be avoided by way of a mutex influence of concurrent read and write, C ++ also provides a boost :: lock_free way, in addition DPDK also offers a library without lock ring.
Since this is the queue on the IO path access to the queue requires high concurrency, low latency, which requires several methods to assess the overall performance of the above.
Similarities and differences between the three interfaces
C++:std::mutex
This is the C ++ standard library provides not get the lock when the lock-free queue can wait.
boost:lock_free
This is the C ++ library Boost-based lock-free queue, and C ++ Standard Library CAS implemented in
queue interfaces like, except that, the limited length of his queue.
DPDK lockless ring
This is the EAL DPDK layer provides a finite number of elements CAS (compary and swap) to achieve lock-circular queue, commonly used in the SPDK memory pool, or in a DPDK and application program.
Comparison of three methods above interface
Measurement Results
It can be seen by using the lock-free queue DPDK can improve the overall system throughput and IOPS.
Reference links
boost :: lock_free and mutex performance in multi producers and more consumers scenario:
https://blog.csdn.net/wag2765/article/details/84793967
boost: lockfree Usage:
https://www.boost.org/doc/libs/1_55_0/doc/html/lockfree.html