[lldb-dev] Process spawning and shutdown

Zachary Turner zturner at google.com
Tue Sep 16 11:55:42 PDT 2014

The last major piece of the Host layer I'd like to address is process
launching and cleanup.  From looking over the code it seems we have the
following different ways to launch a process:

    * Applescript
    * XPC
    * posix_spawn

Other posix variants:
    * posix_spawn

    * Native windows launcher

Among these, there are a couple of different ways to reap processes on exit
and/or "join" on them.  These are:

    * Applescript    [ No process reaping or monitoring occurs. ]
    * XPC               [ Uses MacOSX-specific dispatch library for
monitoring ]
    * posix_spawn [ Uses MacOSX-specific dispatch library for monitoring ]

Other posix variants:
    * posix_spawn   [ Launches a background thread to monitor for process
exit, join on the thread to join on the process ]

    * Native windows launcher  [ WaitForSingleObject ]

A few questions:

1) Is Join() on a process a useful operation that people would be
interested in seeing implemented for all platforms?

2) On Linux at least, if you don't waitpid() on a process you'll end up
with zombies.  It seems this is true on MacOSX as well, because I see
waitpid() in StartMonitoringChildProcess.  Is this not true for the
Applescript launcher?  Why doesn't the Applescript launching code path call
StartMonitoringChildProcess() anywhere?

3) Speaking of the Applescript launcher, what is it and what is it used for?

I'll probably have more questions as I wrap my head around this a little
more.  Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140916/7df7c5b3/attachment.html>

More information about the lldb-dev mailing list