Remix.run Logo
api 2 hours ago

Take a look at crates like arc_swap if you have a read often write rarely lock case. You can easily implement the RCU pattern. Just be sure to read about how to use RCU properly.

Well done this pattern gives you nearly free reads and cheap writes, sometimes cheaper than a lock.

For frequent writes a good RWLock is often better since RCU can degrade rapidly and badly under write contention.