Can all environment be cached atomically?

From: Yuri <yuri_at_FreeBSD.org>
Date: Fri, 14 Jun 2024 10:26:02 UTC
Imagine the situation when a process has multiple threads which keep 
changing environment variables.

One of the threads attempts to cache all environment variables.


I am curious whether the whole environment can be cached atomically, as 
it exists at some point in time, or this can't be guaranteed and some 
environment variables would have to be cached at different times?


Python's os.environ object is such environment cache, which is created 
when the Python interpreter is initialized.



Thanks,

Yuri