3 ms·
IEEE Std 1003.1-2017 actually specifies chdir() as thread-safe (obviously in the sense that it is atomic but influences all process' threads). It strikes me as
by dfox 8y ago
IEEE Std 1003.1-2017 actually specifies chdir() as thread-safe (obviously in the sense that it is atomic but influences all process' threads).
It strikes me as particularly weird as there are notionally POSIX-conformant OSes that implement it in a way that is not atomic.
- JdeBP 8y agoThread safety is not the issue. The issue is that multiple threads may want multiple different working directories simultaneously, for different work items. But there is one working directory for the process. This problem is partly alleviated by the ...at() family of system calls, of course.