Which Mutex to use in this case (independent tasks, partially under contention)

This page summarizes the projects mentioned and recommended in the original post on /r/rust

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

    Compact and efficient synchronization primitives for Rust. Also provides an API for creating custom synchronization primitives.

  • parking_lot still has an open issue #201: Heavily degraded performance while in extreme contention on some processors which reveals that parking_lot selfishly uses spinning locks under some circumstances to sacriice total system efficiency in the name of trying to improve its own latency. In my opinion, the only place spinning locks are excusable is fullscreen games and, even then, Linus Torvalds is of the opinion they're usually implemented wrong. (Issue 201 also includes a bunch of benchmark runs if you want to read through to figure out which one applies to the current shipping state of the codebase.)

  • proptest

    Hypothesis-like property testing for Rust

  • Third, if you're opting out of a compile-time safety guarantee in the name of performance, test heavily (high-coverage unit tests, property testing, fuzzing, differential fuzzing, etc.) and make use of tools like Loom and Miri's runtime data race detector for unsafe code, which can catch stuff that is beyond the scope of the compiler's guarantees.

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

    An interpreter for Rust's mid-level intermediate representation

  • Third, if you're opting out of a compile-time safety guarantee in the name of performance, test heavily (high-coverage unit tests, property testing, fuzzing, differential fuzzing, etc.) and make use of tools like Loom and Miri's runtime data race detector for unsafe code, which can catch stuff that is beyond the scope of the compiler's guarantees.

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