News for hackers. Stuff that matters.
Re:C stdlib isn't threadsafe and even safe Rust didn't save us by josefx on Wednesday January 22, 2025 @05:54PM (#42798393)
Welcome to the C standard library, the application of mutable global state to literally everything in it has to be the most consistent and predictable feature of the language standard.
Re:C stdlib isn't threadsafe and even safe Rust didn't save us by Sharlin on Thursday January 23, 2025 @04:33AM (#42802355)
I mean, I'm sure it was an okay solution on PDP-11.
Re:C stdlib isn't threadsafe and even safe Rust didn't save us by liontwist on Thursday January 23, 2025 @07:08AM (#42803212)
I used to think this was bad too. But when C was designed an entire single threaded program was considered the unit of encapsulation for functionality. Now it’s mostly libraries.

The former allows you to design a coherent system. a lot of design questions which are annoying (“how do I access config data consistently, etc) become very clear.

It also makes C more productive. If global vars and static locals are unbanned, features like closures become less important.