3 ms·
What is the use case for a mutable environment past initialization? It seems like a complicated and error prone thing to be using no matter if it is thread saf
by larschdk 3y ago
What is the use case for a mutable environment past initialization?
It seems like a complicated and error prone thing to be using no matter if it is thread safe or not. You can set up your own environment before you launch threads, and you can launch child processes with a different environment from the current process without modifying your own. If you fork, you can modify the environment in the child without affecting the parent until you exec.
And even setenv() if it was reentrant and couldn't cause crashes, it wouldn't be thread safe, since threads share the environment and could get their environment changed under their feet.