Re:Rust – How do I create a global, mutable singleton? (2015)
by steveklabnik on Wednesday July 22, 2020 @11:42AM
(#23918200)
Absolutely, I'm not saying that people should be reaching for global state more, I'm saying that if you really need global state, reaching for TLS over a static is often the right call, because you're minimizing the global-ness, which drops some of the type system restrictions.
That is, too many people skip straight to static without even considering TLS, not that they should be using TLS more often in general.
That is, too many people skip straight to static without even considering TLS, not that they should be using TLS more often in general.