Re:Why Ruby App Servers Break on MacOS High Sierra
by mhandley on Thursday October 19, 2017 @05:27AM
(#15506551)
Thinking about it some more, one problem would be what to do with threads that have just called a system call and are waiting for a response. To have both parent and child process system calls complete without errors would require cloning the kernel state, and that's not trivial. It some cases, there's probably no good answer, short of causing one of the two system calls to return an error, and that in itself would confuse a lot of user-space software. I suppose you could return something similar to EAGAIN, but you'd be dependent on user-space handling that cleanly. Maybe you could hide this under libc?
[ Parent
| on HN ]
Re:Why Ruby App Servers Break on MacOS High Sierra
by ScottBurson on Thursday October 19, 2017 @02:26PM
(#15510334)
So this is a worse-is-better design decision driven by a previous worse-is-better design decision. If system calls were interruptible, then the problem of threads in system calls would go away.
Re:Why Ruby App Servers Break on MacOS High Sierra
by wruza on Thursday October 19, 2017 @05:36AM
(#15506593)
EINTR? I suspect some calls are defined to never return it, but it may be just de facto, not strict rule.
Edit: simply signalling all threads with SIGFORK, waiting for a handler to return and freezing a thread at SA_RESTART point feels right way to do it. Why did POSIX decide to fork() only one thread by default at all?