A collection of lock-free data structures written in standard C++11

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • lockfree

    A collection of lock-free data structures written in standard C++11

  • - A lot of code won't work for types with no default constructors, but that is at least compile error

    - Using memcpy[0] for arbitrary types is just wrong, see [1]

    [0] https://github.com/DNedic/lockfree/blob/main/lockfree/inc/bi...

    [1] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p11...

  • spsc_queue

    A fast, concurrent, bounded, single producer, single consumer queue

  • Should be benchmarked against ->

    https://github.com/Deaod/spsc_queue

    If proven faster OK.. If not.. Well.. back to the drawing board.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • tlaplus

    TLC is a model checker for specifications written in TLA+. The TLA+Toolbox is an IDE for TLA+.

  • Checking the invariant with assert is also useful in my limited experience with concurrency.

    https://lamport.azurewebsites.net/tla/tla.html

  • multiversion-concurrency-control

    Implementation of multiversion concurrency control, Raft, Left Right concurrency Hashmaps and a multi consumer multi producer Ringbuffer, concurrent and parallel load-balanced loops, parallel actors implementation in Main.java, Actor2.java and a parallel interpreter

  • I think I lean towards per-thread sharding instead of mutex based or lock free data structures except for lockfree ringbuffers.

    You can get embarassingly parallel performance if you split your data by thread and aggregate periodically.

    If you need a consistent view of your entire set of data, that is slow path with sharding.

    In my experiments with multithreaded software I simulate a bank where many bankaccounts are randomly withdrawn from and deposited to. https://github.com/samsquire/multiversion-concurrency-contro...

    I get 700 million requests per second due to the sharding of money over accounts.

  • I think I lean towards per-thread sharding instead of mutex based or lock free data structures except for lockfree ringbuffers.

    You can get embarassingly parallel performance if you split your data by thread and aggregate periodically.

    If you need a consistent view of your entire set of data, that is slow path with sharding.

    In my experiments with multithreaded software I simulate a bank where many bankaccounts are randomly withdrawn from and deposited to. https://github.com/samsquire/multiversion-concurrency-contro...

    I get 700 million requests per second due to the sharding of money over accounts.

  • glibc

    Discontinued GNU Libc

  • The code isn't the easiest to read but in glibc it seems that the syscall is only performed if waiter are detected in userspace during an unlock operation

    https://github.com/lattera/glibc/blob/master/nptl/pthread_mu...

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts