News for hackers. Stuff that matters.
Re:Don't setenv in multi-threaded code on glibc by mzs on Tuesday January 31, 2017 @04:24PM (#13535373)
look here: http://lxr.free-electrons.com/source/kernel/exit.c?v=3.12#L9...

Conceptually all that you described (plus some more, thing SysV IPC and MM) happens in the kernel (although the behaviour of streams is not specified, I can't think of any OS that does more than close FDs) after the OS has made it so every thread in the process can't go forward. I alluded to the misfeature in glibc, that's why you used to have to do raise(9) on linux to work around the oddity. Every other OS just did the right thing (though you sometimes had to build or link your program differently), ie all threads are 'stopped' before any of the things like closing FDs happens.

There are no comments on this comment yet.