In my experience Left-Write is the clear place to start. It's general purpose and fast for reads. Only if that is unsuitable (eg memory usage) does one design a custom data structure. There's a Rust lib implementation with links to more resources:<p><a href="https://docs.rs/left-right/latest/left_right/" rel="nofollow noreferrer">https://docs.rs/left-right/latest/left_right/</a>
Hello, the author here. It feels great to see my blog on HN!<p>It was quite a journey, at first I thought I invented a novel concurrency schema. However, it turns out that it was simply a mix of my ignorance and hubris! :-)<p>Still, I had a lot of fun while designing this data structure and I believe it made a nice story. Ask me anything!
You could also check out hazard pointers. This is basically the example used in <a href="https://melodiessim.netlify.app/intro-hazard-ptrs/" rel="nofollow noreferrer">https://melodiessim.netlify.app/intro-hazard-ptrs/</a>
Hi. You missed the opportunity to implement the reader as an AutoCloseable and do the get as a Reader method.<p>That way, classe users will be warned by the IDE that they should use a try-with-resources when acquiring a Reader.<p>For the sake of completeness here, Java compiler will warn about it, but that warning is disabled by default.
Did you consider just making an array of HashMap, say 512 of them, and locking only one of them based on your key's hash?<p>Or, more generally, minimizing the odds of waiting on a lock, without resorting to a complex lock free scheme?
Why not just allocating the blobs off-heap? (That is something you probably want to do anyway if it's cryptographic material, to avoid being at the mercy of the GC leaving copies around)<p>ByteBuffer.allocateDirect should do that IIRC. This allows you to use the standard ConcurrentHashMap while being able to get a stable pointer for use by the rust logic.
cool article, I learned a lot, but I’m scratching my head wondering why they’re settling for Java on this project when Rust is better suited for it, seems like with the lifetimes, need for consistency and concurrency, memory leak issues, and generally the goal for high performance, this would be an awesome project for learning Rust