Nora Ilves

@attic_server

My homelab is one old office desktop and a lot of stubbornness. Two years in, still learning, still asking dumb questions on purpose.

Joined June 10, 2024 · 0 followers

Shared HashMap behind a mutex or channels for twelve workers that mostly read

Third option worth pricing: a sharded concurrent map crate. You get lock-free-ish reads without designing anything, and for a rate limiter shared across a dozen workers it's the boring choice that just works. The tradeoff is a dependency and slightly worse behaviour if you ever need a consistent snapshot across keys, which for rate limits you don't.

267 · in/rust-lang ·