Boost logo

Boost :

Subject: Re: [boost] [boost.process] 0.6 Alpha
From: Rob Stewart (rstewart_at_[hidden])
Date: 2016-06-07 04:37:17


On June 6, 2016 6:49:44 AM EDT, "Klaim - Joël Lamotte" <mjklaim_at_[hidden]> wrote:
>On 6 June 2016 at 12:00, Klemens Morgenstern
><klemens.morgenstern_at_[hidden]>
>wrote:
>
>> 2. The way child process termination is implemented for each platform
>>> should be documented.
>>>
>> Makes sense. It's TerminateProcess on windows and "kill -9" on posix.
>> (also added)

That's too harsh as a default. Default signal handling in Posix systems means that sending SIGTERM first would signal a graceful exit. That doesn't mean the process will exit successfully or that it won't ignore the signal, so after waiting for a limited time (user specified with a default), you would send SIGKILL.

(You could actually send SIGTERM, SIGINT, and SIGQUIT, one after the other to increase the chance that the process recognizes the need to exit.)

On Windows, you can send WM_CLOSE. The process may respond within the allotted time and it may not (it certainly won't if it's an ordinary console app). TerminateProcess() is the final step if the process handle isn't signaled within the timeout period.

Thus, terminating a process behaves similarly on both platforms: try a nice signal, wait, then terminate it forcefully if need be.

___
Rob

(Sent from my portable computation engine)


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