Quinine is a Rust library that implements atomic, lock-free, but write-once versions of containers like `Box` or `Arc`

Overview

Quinine

Crates.io docs.rs

Quinine implements atomic, lock-free, but write-once versions of containers like Option > (MonoBox) and Option > (MonoArc).

These write-once containers can be read with mere Ordering::Acquire loads; reads otherwise perform like Box and Arc. On the write-side, atomic updates happen via compare-and-swaps, only the first of which will succeed.

The code is simpler (and likely faster) than, e.g., ArcSwap, because it exploits the monotonic nature of all updates to these write-once containers. That's particularly true for reads, but updates also avoid a lot of coordination overhead with potential concurrent readers.

When atomic containers can only transition monotonically from None to Some, and then stay there, we can implement simple update algorithms, without having to worry about the lifetime of references derived from the container: once we've observed Some value, the container can be trusted to keep it alive for us (until the container is dropped safely). The general form of this trick applies to any container that owns a monotonically increasing set of resources, until the container itself is destroyed.

You might also like...
This is a Telegram bot I'm working on in my free time to learn Rust.

Maldness Bot This is a Telegram bot I'm working on in my free time to learn Rust. Building docker build -t . should be enough.

🦜 A hassle-free, highly performant, host it yourself Discord music bot built with Serenity in Rust. Powered by youtube-dl and Genius.

🦜 A hassle-free, highly performant and fast evolving Discord music bot built with Serenity in Rust. Deployment Usage Just create a bot account, copy

Uindex is a data store, for data that can be parsed as sentences in some context-free language.
Uindex is a data store, for data that can be parsed as sentences in some context-free language.

Uindex - Universal index Uindex is a data store, for data that can be parsed as sentences in some context-free language.

cooptex provides deadlock-free Mutexes.

cooptex provides deadlock-free Mutexes. The [CoopMutex::lock] method wraps the [std::sync::Mutex] return value with a Result that will request

`Debug` in rust, but only supports valid rust syntax and outputs nicely formatted using pretty-please
`Debug` in rust, but only supports valid rust syntax and outputs nicely formatted using pretty-please

dbg-pls A Debug-like trait for rust that outputs properly formatted code Showcase Take the following code: let code = r#" [ "Hello, World!

A Simple, But amazing telegram bot, Made using the Rust language!

Telegram bot in Rust A fun Telegram bot made using Rust language.

kindly is a simple Rust implementation of a set-user-ID-root program, similar to sudo but in a much reduced way.

kindly is a simple Rust implementation of a set-user-ID-root program, similar to sudo but in a much reduced way.

Fetch all your fetches, but in rust
Fetch all your fetches, but in rust

fetchfetch, but in rust Fetch all of your fetches. written in go rust. Installation You can either download the latest release or build from source (r

Do the RWKV thing, but now in Rust with GGML

RWKV, but in Rust with ggml A project which reimplementation llama.cpp in rustformers/llm style. Current situation Performance issue: current version

Owner
Paul Khuong
Paul Khuong
Click-once - A small tiny little binary to fix undesired mouse double clicks in Windows, written in Rust.

click-once A small tiny little binary to fix malfunctioning mouse double clicks in Windows, written in Rust. Minimal executable with little to no over

null 23 Dec 29, 2022
Moonshine CSS - 🥃 High-proof atomic CSS framework

Moonshine CSS - ?? High-proof atomic CSS framework

Econify 25 Nov 25, 2022
Swayidle alternative to handle wayland idle notifications, sleep and lock events in Rust with Lua scripting based configuration language

swayidle-rs This is intended as a replacement of sway's idle management daemon. I use it as a tool to understand rust message passing and state manage

Reza Jelveh 8 Nov 27, 2023
This contract implements simple vote for the best coffe in indonesia using near protocol.

vote-coffe-near Description This contract implements simple vote for the best coffe in indonesia using near protocol. Contract in contract/src/lib.rs

RickhySis25 1 Nov 15, 2021
A repository of examples for esp32s3-box written in Rust

ESP32S3-BOX Examples A repository of examples for esp32s3-box written in Rust Usage hello world cargo espflash --release --monitor esp demo animati

null 8 Dec 19, 2022
mystery box

revup Install Linux First build the executable cargo build --release Then move the binary to your executables folder sudo mv target/release/revup /usr

null 17 Apr 28, 2022
An out-of-box ChatGPT bot for Telegram.

TeleGPT API Docs | Releases | Twitter An out-of-box ChatGPT bot for Telegram. TeleGPT is a Telegram bot based on teloxide framework and async_openai.

null 169 Apr 7, 2023
An out-of-box ChatGPT bot for Telegram.

TeleGPT API Docs | Releases | Twitter An out-of-box ChatGPT bot for Telegram. TeleGPT is a Telegram bot based on teloxide framework and async_openai.

null 173 Apr 16, 2023
A tool that, like, screams at you when you say like

Dislike Do you, like,... dislike constantly saying "like" as much as I do? Then, like,... you've come the right place! This tool is like EXACTLY what

ElKowar 27 Jun 27, 2022
Write Cloudflare Workers in 100% Rust via WebAssembly. (A fork of workers-rs)

Note: This is a fork to workers-rs. Work-in-progress ergonomic Rust bindings to Cloudflare Workers environment. Write your entire worker in Rust! Read

Abid Omar 7 Jan 11, 2023