2 ms·
The described problem (thread safety) for a global configuration seems mostly a misunderstanding by the author. The usual case for modifying a global state is:
by xxs 3y ago
The described problem (thread safety) for a global configuration seems mostly a misunderstanding by the author.
The usual case for modifying a global state is: modify once, then proceed (e.g. start new threads). Even if all the calls become thread safe, the behavior would be inconsistent, still.
- hddqsb 3y agoIt is perfectly reasonable and consistent for one thread to set an environment variable while other threads are reading different environment variables.