3 ms·
Thread locals are thread local, so you don't need AtomicUsize, you just need a Cell, which has zero overhead. https://is.gd/c0iCz6 https://is.gd/c0iCz6 Edit:
by Manishearth 10y ago
Thread locals are thread local, so you don't need AtomicUsize, you just need a Cell, which has zero overhead.
https://is.gd/c0iCz6 https://is.gd/c0iCz6
Edit: Zero overhead as compared to C, that is. Cell has a slight overhead in Rust because it prevents certain optimizations that aren't the default in C.
- burntsushi 10y agoDerp. Thanks for that correction. :-)