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.
bytemuck uses a number of traits to provide safe APIs for bitcasts in cases where it's actually safe. This doesn't cover the full spectrum of safety in Rust (I imagine Send and Sync aren't too relevant here?), but if you can understand how this crate provides a safe API on top of a fair bit of unsafe, then you'll be well on your way here. (For extra credit, study zerocopy as well, which lives in a similar domain. Compare its use of unsafe and the functionality it provides with bytemuck.) I mention these crates because after a cursory look, they have decent comments describing safety obligations. So you have a decent chance of actually understanding the boundary between safe and unsafe here.
bytemuck uses a number of traits to provide safe APIs for bitcasts in cases where it's actually safe. This doesn't cover the full spectrum of safety in Rust (I imagine Send and Sync aren't too relevant here?), but if you can understand how this crate provides a safe API on top of a fair bit of unsafe, then you'll be well on your way here. (For extra credit, study zerocopy as well, which lives in a similar domain. Compare its use of unsafe and the functionality it provides with bytemuck.) I mention these crates because after a cursory look, they have decent comments describing safety obligations. So you have a decent chance of actually understanding the boundary between safe and unsafe here.
Shooting from the hip, crossbeam might be a good candidate for understanding the thread safety aspects of Rust. I kind of feel like this is probably "too big" of a project if you're just learning, but I can't think of something smaller off the top of my head that would be suitable.
Related posts
- Hyperbridge: Fast multi-producer, multi-consumer unbounded channel in Rust
- I wrote a post about background processing library - Fang
- multi-producer multi-consumer channels for message passing python library
- I needed to write a simple multi-threaded message processing queue in C++ today. Makes me really appreciate how easy this is to do in Rust.
-
crossbeam VS scalable-concurrent-containers - a user suggested alternative
2 projects | 13 Apr 2023