4 ms·
I wonder if you could get around this by giving each thread its own environment context, and synchronizing them, asynchronously.
by Retr0id 3y ago
I wonder if you could get around this by giving each thread its own environment context, and synchronizing them, asynchronously.
- deleted 3y ago[deleted]
- gpderetta 3y agoJust independent environments would be the best, like it was done for locale with uselocale. But it is a breaking change, would have to go through posix and will take forever anyway. Also, as environ is a public symbol, it has ABI implications.
- tinus_hn 3y agoBecause there is no way to tell when a thread is done with the buffer, there is no moment when you can be sure you can manipulate it. The options are create a new copy and leak the old one or accept the chance of a segfault.