Process trees and termination

David M. Lloyd david.lloyd at redhat.com
Wed Jun 25 22:05:58 UTC 2014


On 06/25/2014 04:52 PM, roger riggs wrote:
> Hi,
>
> The next step for JEP 102, Process API Updates is to provide an API to
> enumerate the hierarchy of processes and to be able to terminate a
> process tree.
>
> This draft javadoc <http://bussund0416/%7Erriggs/pdoc/>update [1] includes:
>   - ProcessHandle class to provide handles to processes, their children,
>      parent, process id and liveness
>   - Process extends ProcessHandle and inherits the new behaviors
>   - Method destroyProcessTree() terminates a process tree
>
> Additional functions related to termination and information about processes
> will be added in a later update.
>
> Comments appreciated, Roger

I still have a not-great feeling about the lack of atomicity inherent in 
these operations.  At least when you're dealing with direct child 
processes (on UNIX-likes), there is some measure of control, in that a 
process is zombified until reaped by wait() and friends.

Also I have a much higher level of concern about destroyProcessTree(), 
which I don't think has any place in this API.  Control of any process 
belongs solely with their parent (or PID 1), in my opinion.

Those concerns aside, what about making the allChildren() and 
allProcesses() methods lazy in some way?

-- 
- DML



More information about the core-libs-dev mailing list