Concurrent, lock-free hash map in C. Can we do it in Rust?

I’ve stumbled across a fascinating article about arena memory management in C and how it’s used to write a concurrent lock free hashmap. I think it’s generally understood that lock-free concurrency is usually considered as one of the harder problems in existence.

https://nullprogram.com/blog/2023/09/30/

I don’t have any C expertise at all, but the concept seems intriguing to me.

Does anyone with more experience know if something like this can be done in unsafe Rust? Should it be done? Any thoughts?

lockfree::Map

1 Like

Anything using atomics is generally unsafe. But yes, it can definitely be done with unsafe.

1 Like

Thanks for sharing this crate.