My understanding is that getenv() and setenv() operate within the calling process' memory space, not within the entire OS' space, and therefore synchronizing access at the thread level would mitigate collisions.  Is that not true?