[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    RE: [OT] poll() vs. AIO (was: [PATCH] ash: clear NONBLOCK flag from
From:       "Cathey, Jim" <jcathey () ciena ! com>
Date:       2011-08-22 16:51:10
Message-ID: F4AC465B29B61A4FA792A4E6FEA8A202017F5768 () wamxm01 ! ciena ! com
[Download RAW message or body]

>I'd like to know how else, other than this ugly SIGCHLD handler, you
>can create a child process without having the keep track of the pid
>and have part of your code be responsible for waiting for it.

Just use the asynchronous waitpid.  Oh, sorry, we're not talking
about DNIX here are we?  :-)  Its kernel would satisfy waitpids
before more generic waits, if multiple wait requests were queued.
(Internally ALL requests are the same, asynchronous, the usual
synchronous API wait point was in the system-to-user transition
code.  Tres elegant.)

>I already explained how this could lead to *unbounded* memory growth
>through leaks that are nearly impossible to fix, unless all your
>forking happens from a common parent that doesn't grow.

The only benefit of the fork helper we were forced to implement is
that the fork cost is less, since the massive application is no longer
the process that forks but rather its quite svelte first child.  These
forks, however, do not inherit any interesting memory state and so
are really only suitable for forks followed by exec.

-- Jim




_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic