Hacker News new | ask | show | jobs
by goeiedaggoeie 516 days ago
setenv and getenv have never been thread safe, why the concern with it now?
1 comments

The concern now is that, unlike when Posix was set in stone, threads exist.
The p in pthreads stands for Posix. I.e., uh, Posix is neither set in stone, nor entirely predates threads.
I am old enough to remeber when UNIX only had processes, and several thread designs were being discussed until eventually pthreads one design won.

POSIX predates adoption of threads in the UNIX world.

Yes, yes, but also post-dates adoption of threads. It's an ongoing standard.
Which only standardises existing practice, not inventing new ideas.

So first everyone implementing POSIX has to agree to move forward with thread safety where it fails short.

And when can we expect the version of Posix that fixes setenv to be MT-safe?
You've shifted the goalposts from the comment I responded to.
Not at all, because if Posix wasn't set in stone, then surely it would take somewhat less than three-ish decades to fix this problem.