sync_cow

Crates.iosync_cow
lib.rssync_cow
version0.1.1
sourcesrc
created_at2023-01-03 16:08:16.418379
updated_at2023-01-03 16:13:13.775766
descriptionThread-safe clone-on-write container for fast concurrent writing and reading.
homepagehttps://github.com/w0xel/sync_cow
repositoryhttps://github.com/w0xel/sync_cow
max_upload_size
id750232
size17,926
(w0xel)

documentation

README

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

Commit count: 8

cargo fmt