3 ms·
IMHO - I am sympathetic to the BSDs, Apple (presumably forked BSD), and musl approach. In what sane world would someone reasonable treat (initial shell) Enviro
by mjevans 3y ago
IMHO - I am sympathetic to the BSDs, Apple (presumably forked BSD), and musl approach.
In what sane world would someone reasonable treat (initial shell) Environment Variables as a proper ACID complaint database? About the 'best' solution I can see for preventing segmentation faults related to resizing the env array during runtime is to defer reclaiming freed memory chunks until after all in-process threads have been given another uninterrupted timeslice to process. Even that wouldn't be 100% but probably would cover any not pathological case.
- bensecure 3y agoatomic ordering is very easy if you don't care about performance. So on the other hand we could ask why get/put/setenv have such a terrible need for performance that we can't afford to put a simple lock around them.