Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Another option I can think of - but not completely sure how one would implement in Rust - would be to never mutate the shared state, but rather when updating it - completely swapping it out with a completely new copy of the desired state. There's lots of different ways to go about doing this - each with their own trade offs. But using some form of Persistent Data Structure would probably be a good way to start. If you only have a single writer - then I believe using a Cell and simply updating which version of the structure is being read could work. rpds seems to be a decent start to look at these sorts of structures in Rust.
Related posts
- TheAlgorithms/Rust: All Algorithms Implemented in Rust
- Roll your own auth with Rust and Protobuf
- generic-array 1.0, a crate for defining generically-sized arrays without const-generics.
- How to synchronize access to application data in multithreaded asio?
- How do you go about the lack of built in data structure like stack, queue for LeetCode