Thread-safe clone-on-write container for fast concurrent writing and reading.

Overview

sync_cow

Crates.io Docs.rs CI Crates.io - License

GitHub open issues open pull requests

Thread-safe clone-on-write container for fast concurrent writing and reading.

SyncCow is a container for concurrent writing and reading of data. It's intended to be a faster alternative to std::sync::RwLock. Especially scenarios with many concurrent readers heavily benefit from SyncCow. Reading is guaranteed to be lock-less and return immediately. Writing is only blocked by other write-accesses, never by any read-access. A SyncCow with only one writer and arbitrary readers will never block. As SyncCow stores two copies of it's contained value and read values are handed out as std::sync::Arc, a program using SyncCow might have a higher memory-footprint compared to std::sync::RwLock.

Note that readers might read outdated data when using the SyncCow, as writing and reading concurrently is possible. If that is indesireable consider std::sync::RwLock.

Installation

Please use cargo-edit to always add the latest version of this library:

cargo add sync_cow

Examples

See the following examples:

License

Licensed under the

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be licensed as above, without any additional terms or conditions.

Changelog

Versioning

sync_cow strictly follows Semantic Versioning 2.0.0

This includes the Rust version requirement specified above.
Earlier Rust versions may be compatible, but this can change with minor or patch releases.

Which versions are affected by features and patches can be determined from the respective headings in CHANGELOG.md.


mooo

You might also like...
Blazing fast, memory safe & modern Linux package manager written in Rust.

paket Blazing fast, memory safe & modern Linux package manager written in Rust. Roadmap Version: 0.1 Paket.toml file parsing. (#1, #2) CLI handling (p

clone of grep cli written in Rust. From Chapter 12 of the Rust Programming Language book

minigrep is a clone of the grep cli in rust Minigrep will find a query string in a file. To test it out, clone the project and run cargo run body poem

Twitter clone written in Rust.

Percent A Work In Progress Twitter clone written in Rust. Requirements Docker compose Rust Building Run: cargo build Running Start database: docker-co

Derive `clone_from` for `Clone` in Rust

Derive Clone including clone_from This crate offers a derive macro called CloneFrom to derive Clone with a specialized clone_from implementation. When

Aim is to make PCBoard clone that's finished on PCboards 100th birthday
Aim is to make PCBoard clone that's finished on PCboards 100th birthday

icy_board Aim is to make PCBoard clone that's finished on PCboards 100th birthday - for sure it'll take much time. I've started to port a PPL decompil

🕶 Assorted checks and validations for writing safer Solana programs.
🕶 Assorted checks and validations for writing safer Solana programs.

vipers 😎 Assorted checks and validations for writing safer Solana programs. Motivation Solana's fee mechanism is unlike Ethereum's, in that the numbe

S-expression parsing and writing in Rust

rsexp S-expression parsing and writing in Rust using nom parser combinators. This implemantion aims at being compatible with OCaml's sexplib. The main

A cli tool to write your idea in terminal
A cli tool to write your idea in terminal

Ideas ideas is a cli tools to write your idea in your terminal. Demo Features tagged idea, contains tips, idea, todo status switch ascii icon write yo

Write Cloudflare Workers in 100% Rust via WebAssembly
Write Cloudflare Workers in 100% Rust via WebAssembly

Work-in-progress ergonomic Rust bindings to Cloudflare Workers environment. Write your entire worker in Rust! Read the Notes and FAQ Example Usage use

Releases(v0.1.1)
Owner
null
This project contains small exercises to get you used to reading and writing Rust code

rustlings ?? ❤️ Greetings and welcome to rustlings. This project contains small exercises to get you used to reading and writing Rust code. This inclu

Cynthia Tran 1 May 24, 2022
Linked Atomic Random Insert Vector: a thread-safe, self-memory-managed vector with no guaranteed sequential insert.

Linked Atomic Random Insert Vector Lariv is a thread-safe, self-memory-managed vector with no guaranteed sequential insert. It internally uses a linke

Guillem Jara 8 Feb 1, 2023
Compact, clone-on-write vector and string.

ecow Compact, clone-on-write vector and string. Types An EcoVec is a reference-counted clone-on-write vector. It takes up two words of space (= 2 usiz

Typst 78 Apr 18, 2023
A simple thread schedule and priority library for rust

thread-priority A simple library to control thread schedule policies and thread priority. If your operating system isn't yet supported, please, create

Victor Polevoy 62 Dec 5, 2022
Cogo is a high-performance library for programming stackful coroutines with which you can easily develop and maintain massive concurrent programs.

Cogo is a high-performance library for programming stackful coroutines with which you can easily develop and maintain massive concurrent programs.

co-rs 47 Nov 17, 2022
Rust library for concurrent data access, using memory-mapped files, zero-copy deserialization, and wait-free synchronization.

mmap-sync mmap-sync is a Rust crate designed to manage high-performance, concurrent data access between a single writer process and multiple reader pr

Cloudflare 97 Jun 26, 2023
Shuttle is a library for testing concurrent Rust code

Shuttle Shuttle is a library for testing concurrent Rust code. It is an implementation of a number of randomized concurrency testing techniques, inclu

Amazon Web Services - Labs 373 Dec 27, 2022
A lock-free, partially wait-free, eventually consistent, concurrent hashmap.

A lock-free, partially wait-free, eventually consistent, concurrent hashmap. This map implementation allows reads to always be wait-free on certain pl

Ian Smith 216 Nov 18, 2022
Code sample for "Reading files the hard way Part 3"

read-raw-ext4 Rust code sample to read an ext4 partition from Rust, for: https://fasterthanli.me/series/reading-files-the-hard-way/part-3 Usage Don't.

amos 10 Mar 25, 2023
sodiumoxide clone, now with less chlorides and more oxides

sodiumoxide2 Less Chlorides, more Oxides! This package is a fork of sodiumoxide, using rust-native crypto. It's not intended to be easy to use or impl

Conrad Ludgate 3 Apr 16, 2023