Subject: [Boost-bugs] [Boost C++ Libraries] #13110: cannot wait/join process to actually terminate after calling child::terminate
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-07-07 09:04:57
#13110: cannot wait/join process to actually terminate after calling
child::terminate
----------------------------------------+---------------------
Reporter: Christian Maaser <boost@â¦> | Owner: (none)
Type: Bugs | Status: new
Milestone: To Be Determined | Component: process
Version: Boost 1.64.0 | Severity: Problem
Keywords: |
----------------------------------------+---------------------
On Windows child::terminate() calls TerminateProcess, which is
asynchronous. I need to wait for the process to actually terminate, but
join()/wait() early out because a) _terminated gets set to true and b) the
process handle is closed within terminate().
The Unix implementation uses waitpid() after calling kill() to wait for
the process state to change, thus the behaviour is different.
From MSDN: "TerminateProcess is asynchronous; it initiates termination and
returns immediately. If you need to be sure the process has terminated,
call the WaitForSingleObject function with a handle to the process."
Because waiting for a process to actually terminate might take a long time
I think it would be best to use a parameter to specify whether terminate()
shall wait or not, and allow waiting for the process after calling
terminate(). Alternatively please provide a async_terminate() and fix the
Windows implementation to wait internally.
-- Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13110> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-07-07 09:08:15 UTC