> On May 19, 2020, at 5:41 AM, Jean-Paul Calderone <exar...@twistedmatrix.com> > wrote: > > On Tue, May 19, 2020 at 8:33 AM Barry Scott <barry.sc...@forcepoint.com > <mailto:barry.sc...@forcepoint.com>> wrote: > On Monday, 18 May 2020 22:21:16 BST Tom Most wrote: > > > > > If looking improve process management in Twisted, I think that the > > lowest-hanging fruit is to watch children with pidfd, rather than reaping > > all children on SIGCHLD. This O(n) reaping --- one waitpid() call per > > running process --- starts to consume substantial CPU. IIRC it pegged a > > core at 20,000 processes or so. > > Why not waitpid for all children (pid=0 or pid=-1) in a single call? > > Barry > > Because then you might reap a child process someone launched with a different > API - eg the Python subprocess module.
In case it is not clear from context - we used to do exactly this. It broke a lot of stuff. The current approach is slow, but robust. -g
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python