Boost logo

Boost :

Subject: Re: [boost] Process library with child process events
From: Jeff Flinn (Jeffrey.Flinn_at_[hidden])
Date: 2011-06-02 08:57:20


Klaim - Joël Lamotte wrote:
> Hi,
>
> On Wed, Jun 1, 2011 at 14:12, Jeff Flinn <Jeffrey.Flinn_at_[hidden]> wrote:
>
>> Gregory Crosswhite wrote:
>>> Hey everyone,
>>>
>>> Since there is not yet a Boost.Process library, does anyone have a
>>> suggestion for a lightweight cross-platform C++ library for launching and
>>> monitoring (i.e. being able to tell if they die) child processes?
>>>
>> I've put the code from the recent boostcon "boost process" presentation
>> that Boris Schaeling and I gave at:
>>
>> https://github.com/JeffFlinn/boost-process
>>
>> Initial documentation is at:
>>
>> https://docs.google.com/document/pub?id=1qdpxcJB51WMuNYlKYPkPcZZGuPj7zmeUPIpHCd-aetE
>>
>> The intent is to get this completed and ask for review this summer. The
>> areas needing work are:
>
> I've read the current (clearly incomplete w.i.p.) doc and parsed the

Very w.i.p. :-(

> headers and I like the design so far.

Thanks.

> However, I can't find a way to be notified if a child process did end, by
> getting to the end of the program or by having crashed or by having being
> shut down by external processes, the OS or the user.
>
> Did I miss something? If not, what is supposed to happen in the parent
> process if a child do get to an end (whatever the cause)?

This area needs more work, there is just enough there to support our
current needs. The boost::process::monitor::join method is used to wait
for a child process to 'finish' due to whatever cause, which returns the
exit code on windows and the status on posix.

There is a template method boost::process::monitor::join<class
EXCEPTION> that throws a default constructed exception of the supplied
type when join returns a non-zero value.

Can you provide a more concrete set of requirements?

The previous iteration(s) of process had an asynch wait facility that
may be able to be used with the latest design. Boris, do you have any
ideas here?

Jeff


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk