Hacker News new | ask | show | jobs
by Manishearth 3466 days 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

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.

1 comments

Derp. Thanks for that correction. :-)