Re: [RFC] rcexecr: rcorder in parallel

From: Jilles Tjoelker <jilles_at_stack.nl>
Date: Sat, 4 Jun 2011 14:27:03 +0200
On Sat, Jun 04, 2011 at 12:45:37PM +0100, Julien Laffaye wrote:
> On Sat, Jun 4, 2011 at 10:10 AM, Buganini <buganini_at_gmail.com> wrote:
> > https://github.com/buganini/rcexecr

> > Currently it is able to determine the exec/wait order

> > There are something I haven't digged in deeply in the "self
> > modification" part.

> > patches/ideas are welcome.

> Thanks for doing that!

Yes.

> You should use kqueue(2) instead of waitpid(2) so that you can
> efficiently monitor a pool of processes.
> See pwait(1) for an example.

Hmm, I don't think kqueue() should be used here. Its main advantage is
that it works regardless of parent-child relationships, but that
advantage is not relevant here. On the other hand, waitpid() is still
necessary to get rid of the zombies. Furthermore, waitpid() is standard
while kqueue() is not, and I think non-standard interfaces should only
be used if they provide a real benefit above standard interfaces.

The current approach with waitpid() for specific processes should be
good enough for a proof of concept. It will keep zombies longer than
necessary, particularly for things that are not explicitly depended on.
To avoid this, use waitpid(-1, ...) and maintain more tracking for
processes that have already terminated.

-- 
Jilles Tjoelker
Received on Sat Jun 04 2011 - 10:27:04 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:14 UTC