Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Jun 2011 14:27:03 +0200
From:      Jilles Tjoelker <jilles@stack.nl>
To:        Julien Laffaye <jlaffaye@freebsd.org>
Cc:        freebsd-hackers@freebsd.org, Buganini <buganini@gmail.com>, FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: [RFC] rcexecr: rcorder in parallel
Message-ID:  <20110604122703.GB33796@stack.nl>
In-Reply-To: <BANLkTi=S2EBo_ajo2q1Bc4DSmpwatRtXNw@mail.gmail.com>
References:  <BANLkTin3gUFt9erp88HMfingZTG0wdzVog@mail.gmail.com> <BANLkTi=S2EBo_ajo2q1Bc4DSmpwatRtXNw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jun 04, 2011 at 12:45:37PM +0100, Julien Laffaye wrote:
> On Sat, Jun 4, 2011 at 10:10 AM, Buganini <buganini@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110604122703.GB33796>