MutexProtected: A C++ Pattern for Easier Concurrency

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
  • serenity

    The Serenity Operating System 🐞

  • Another feature of the MutexProtected implementation in SerenityOS is the ability to either obtain an exclusive lock (writable) or a shared lock (read-only). A shared lock provides a const reference to the protected value and therefore enforces read-only access semantics at compile-time by leveraging the C++ type system (specifically, const-correctness).

    The initial PR introducing the ancestor to MutexProtected has some details on the motivation behind it and also demonstrates a bunch of incorrect locking that the C++ compiler caught when introducing it: https://github.com/SerenityOS/serenity/pull/8851

  • Folly

    An open-source C++ library developed and used at Facebook.

  • How does this compare with:

    * Using std::atomic ? https://en.cppreference.com/w/cpp/atomic/atomic

    * folly::Synchronized, mentioned by ot57? https://github.com/facebook/folly/blob/main/folly/docs/Synch...

    * Boost synchronized data structures, -mentioned by mchicken 53? https://www.boost.org/doc/libs/1_81_0/doc/html/thread/sds.ht...

    ?

    ... it looks like the SerenityOS people developed this without considering the C++ ecosystem of today.

  • 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
  • rustex

    Rust-style mutex type for C++

  • Adding my favorite to the pile: https://github.com/dragazo/rustex

  • sdk

    SDK files for building i-score (by ossia)

  • Boost isn't gigabytes in size wat are you talking about. All the headers are here in this 14mb archive: https://github.com/ossia/sdk/releases/download/sdk25/boost_1... and that is enough to use 90% of the boost libs as they are mostly header only

  • chromium

    The official GitHub mirror of the Chromium source

  • Chrome does this, more or less, with different syntax. https://chromium.googlesource.com/chromium/src/+/main/docs/t...

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
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