HArcMut

Crates.ioHArcMut
lib.rsHArcMut
version1.1.1
sourcesrc
created_at2023-05-25 13:30:27.121167
updated_at2024-05-15 12:32:04.140016
descriptionmutable arc
homepage
repositoryhttps://github.com/hyultis/HArcMut
max_upload_size
id874298
size21,465
(hyultis)

documentation

README

HArcMut

A library that mimic a mutable Arc.

I use a shared RwLock, that permit a writable Data between thread and a local ReadOnly version for faster/simplest access. Data is synchronized on get (not on write !) to assure getting the updated version when needed.

Data need to have the "Clone" trait

use Parking_lot and arc-swap for sync stuff

Beware : for a safe memory clear, you need to drop each clone, everywhere. To help with that, you need to check the return of "isWantDrop()", and removing the local instance from your storage (and doing that for each system that hold a clone)

Online Documentation

Master branch

Example

You can check the test as example, here : https://github.com/hyultis/HArcMut/blob/master/tests/tests.rs

License

Licensed under either of

at your option.

Contribution

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

Commit count: 22

cargo fmt