I've been experimenting with Rust lately, and have just started following Jon Gjengset's videos. In his latest livestream, Jon started a port of the Java ConcurrentHashMap
to Rust. I highly recommend them; it's fun to see how someone with a lot of Rust experience approaches problems.
One of the things that grabbed my attention was his use of crossbeam::epoch
. It's a library that helps you write certain kinds of lock-free concurrent data structures, using an "epoch counter" that allows you to disconnect objects from your main data structure and they will be freed later-- without using any per-object atomic reference counters or other major GC overhead.