The Fastest Mutexes

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

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
Nutrient - The #1 PDF SDK Library
Bad PDFs = bad UX. Slow load times, broken annotations, clunky UX frustrates users. Nutrient’s PDF SDKs gives seamless document experiences, fast rendering, annotations, real-time collaboration, 100+ features. Used by 10K+ devs, serving ~half a billion users worldwide. Explore the SDK for free.
nutrient.io
featured
  1. cosmopolitan

    build-once run-anywhere c library

    Case in point:

    https://github.com/jart/cosmopolitan/blob/master/libc/sysv/s...

    The system call numbers of all the unixlikes are bitwise packed into a single number. There is exactly one of those columns which is stable: the Linux one. Everything else is not part of the binary interface of their respective operating systems.

    I've written about how Linux is special in this regard:

    https://www.matheusmoreira.com/articles/linux-system-calls

    It's a neat hack but I'm afraid it's in grave danger of falling victim to the Darth Vader of OS ABI stability.

    https://lwn.net/Articles/806870/

    > Program to the API rather than the ABI.

    > When we see benefits, we change the ABI more often than the API.

    > I have altered the ABI.

    > Pray I do not alter it further.

  2. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  3. Folly

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

    I was thinking the same. There are many mutexes out there, some are better at certain workloads than the rest. DistributedMutex and SharedMutex come to mind (https://github.com/facebook/folly/blob/main/folly/synchroniz..., https://github.com/facebook/folly/blob/main/folly/SharedMute...) Just like hashmaps, it's rarely the case that a single hashmap is better under _all_ possible workloads.

  4. NumPy

    The fundamental package for scientific computing with Python.

    https://github.com/numpy/numpy/issues/26510#issuecomment-229...

    And now that I look at that again I realize I forgot to finish that up!

  5. llamafile

    Distribute and run LLMs with a single file.

    Mozilla has a project called Llamafile (https://github.com/Mozilla-Ocho/llamafile) that's based on Cosmopolitan libc. And they do regularly publish popular models repackaged in that format on Hugging Face: https://huggingface.co/models?search=llamafile.

    Whether that in turn has any practical use beyond quickly trying out small models is another question.

  6. EAThread

    EAThread implements a unified cross-platform interface for multithreaded programming.

  7. golang-crossbuild

    what worked for me for cross-compiling go:

    https://github.com/elastic/golang-crossbuild docker images for macos and windows (not linux though)

    https://github.com/rust-cross/rust-musl-cross

  8. rust-musl-cross

    Docker images for compiling static Rust binaries using musl-cross

    what worked for me for cross-compiling go:

    https://github.com/elastic/golang-crossbuild docker images for macos and windows (not linux though)

    https://github.com/rust-cross/rust-musl-cross

  9. Nutrient

    Nutrient - The #1 PDF SDK Library. Bad PDFs = bad UX. Slow load times, broken annotations, clunky UX frustrates users. Nutrient’s PDF SDKs gives seamless document experiences, fast rendering, annotations, real-time collaboration, 100+ features. Used by 10K+ devs, serving ~half a billion users worldwide. Explore the SDK for free.

    Nutrient logo
  10. nsync

    nsync is a C library that exports various synchronization primitives, such as mutexes

    For what it is worth it seems the library in question does both, uses an exponential backoff loop, busy read looping 2^i times for the first 7 attempts before then yielding. It seems like there must be some threshold where latency is improved by retrying before yielding, but I don’t test these things for a living.

    https://github.com/google/nsync/blob/c6205171f084c0d3ce3ff51...

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

  • How do I cross compile for Rasperry Pi 64 bit on Windows?

    7 projects | /r/learnrust | 11 Feb 2023
  • Hey Rustaceans! Got a question? Ask here! (36/2022)!

    5 projects | /r/rust | 5 Sep 2022
  • Show /r/rust: a Rust implementation of the Realworld demo app spec using Axum and SQLx, written by a co-author of SQLx.

    11 projects | /r/rust | 31 Jan 2022
  • Running Rust on AWS Lambda on ARM64

    3 projects | dev.to | 6 Oct 2021
  • rust-musl-cross docker images added linux/arm64 architecture support

    2 projects | /r/rust | 23 Mar 2021

Did you know that C++ is
the 7th most popular programming language
based on number of references?