4 ms·
It is both, the implementation and all of the ideas behind it. These should give you some idea on what is going on there: https://golang.org/src/net/fd_mutex.
by zzzcpan 11y ago
It is both, the implementation and all of the ideas behind it.
These should give you some idea on what is going on there:
https://golang.org/src/net/fd_mutex.go https://golang.org/src/net/fd_mutex.go
https://golang.org/src/net/fd_unix.go#L237 https://golang.org/src/net/fd_unix.go#L237
https://golang.org/src/syscall/exec_unix.go#L17 https://golang.org/src/syscall/exec_unix.go#L17
- gpderetta 11y agoOh $DEITY. That can't be possibly right. Are they serialising all FD creation thru a single mutex?? Why they can't just close all sockets that need closing after fork? Also the FD mutex that need to be taken before each read and write is nasty (is it just to prevent a race with close or is it for something else?), but at least that won't usually require any syscall and on sane applications could be optimised with a Java-like biased lock.