3 ms·
Option 1) is not feasible though, as you'll block your one thread. Though I wonder if you can work around all this by using signalfd (http://man7.org/linux/man
by noselasd 11y ago
Option 1) is not feasible though, as you'll block your one thread.
Though I wonder if you can work around all this by using signalfd (http://man7.org/linux/man-pages/man2/signalfd.2.html http://man7.org/linux/man-pages/man2/signalfd.2.html) and have SIGCHLD delivered through normal file descriptors - I don't know the low levels of Go enough to know if you can integrate a raw file descriptor with its runtime, or whether messing with SIGCHLD causes other issues, but it might be worth pursuing.
- nteon 11y agoYou could easily do a syscall to get a signalfd file descriptor, then call os.NewFile to turn that numerical FD into a Go *os.File (https://golang.org/pkg/os/#NewFile https://golang.org/pkg/os/#NewFile). It seems like that should work fine!