News for hackers. Stuff that matters.
Re:Goodbye C++, Hello C by Jweb_Guru on Saturday June 26, 2021 @02:48AM (#27639738)
> Well, kind of. I would argue that most code does not need to be thread safe because it is not intended to run in a multi-threaded environment.

In that case you are actually thread safe, though! Just use a language that lets you specify which data can't be sent across threads (Rust isn't the only example, Erlang enforces this entirely dynamically) and use thread locals instead of statics (in a single threaded environment they're effectively the same thing), and tada, you have thread safety that continues to work even if people decide to run your stuff on many different cores.

There are no comments on this comment yet.