parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Your opinion needed: Should GNU Parallel ignore, kill or wait for ba


From: Martin d'Anjou
Subject: Re: Your opinion needed: Should GNU Parallel ignore, kill or wait for background children?
Date: Mon, 23 May 2016 21:55:32 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0

Do not leak processes. In the simple case, it is as bad as leaking memory, and worst, the leaked process may monopolize external resources like files, or a database, etc.

I expect GNU Parallel to wait until everything it has started also has completed, and I also expect GNU Parallel to return a non-zero exit code if one of the processes it launched returned a non-zero.

If you don't want to wait for GNU Parallel, then backgroud GNU Parallel itself, and hold on to that PID if you want, but do not let children leak to the OS by default.

GNU Make, which has a parallel feature, does not leak processes. GNU Parallel should not leak either.

Martin

On 16-05-23 06:46 PM, Ole Tange wrote:
Should GNU Parallel ignore, kill or wait for background children?

Example:

$ parallel '(sleep 100) & echo' ::: 1
1
$ ps -opid,pgrp,cmd
     PID    PGRP CMD
  915719  915719 /bin/bash
  937618  937617 sleep 100
  937620  937620 ps -opid,pgrp,cmd

The sleep is put in the background. The echo finishes, and GNU
Parallel exits, while the sleep is still running.

Is this what you expect?

Or do you expect GNU Parallel to wait for the background job? Should
it do that for every job? Or just when GNU Parallel is about to exit?

Or do you expect GNU Parallel to kill the background job? Should it do
that for every job? Or just when GNU Parallel is about to exit?


/Ole





reply via email to

[Prev in Thread] Current Thread [Next in Thread]