Re: [PATCH 03/10] run-command: add an asynchronous parallel child processor

2015-09-18 Thread Stefan Beller
On Thu, Sep 17, 2015 at 6:05 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> On Thu, Sep 17, 2015 at 2:44 PM, Junio C Hamano wrote: >> >>> Hmm, you are relying on the fact that a valid pid can never be 0, so >>> you can just use pp->children[i].child.pid to see if a "slot" is >>> occupied

Re: [PATCH 03/10] run-command: add an asynchronous parallel child processor

2015-09-17 Thread Junio C Hamano
Stefan Beller writes: > On Thu, Sep 17, 2015 at 2:44 PM, Junio C Hamano wrote: > >> Hmm, you are relying on the fact that a valid pid can never be 0, so >> you can just use pp->children[i].child.pid to see if a "slot" is >> occupied without even using pp->slots[] (or pp->children[i].in_use). > >

Re: [PATCH 03/10] run-command: add an asynchronous parallel child processor

2015-09-17 Thread Stefan Beller
On Thu, Sep 17, 2015 at 2:44 PM, Junio C Hamano wrote: > Hmm, you are relying on the fact that a valid pid can never be 0, so > you can just use pp->children[i].child.pid to see if a "slot" is > occupied without even using pp->slots[] (or pp->children[i].in_use). We could either use the pid as a

Re: [PATCH 03/10] run-command: add an asynchronous parallel child processor

2015-09-17 Thread Junio C Hamano
Stefan Beller writes: > time --> > output: |---A---| |-B-| |C---| |-D-| |-E-| Be nice and distribute the line evenly around "C". Same for thread 2 below. > diff --git a/run-command.c b/run-command.c > index c892e9a..3af97ab 100644 > --- a/run-command.c > +++ b/run-command

[PATCH 03/10] run-command: add an asynchronous parallel child processor

2015-09-16 Thread Stefan Beller
This allows to run external commands in parallel with ordered output on stderr. If we run external commands in parallel we cannot pipe the output directly to the our stdout/err as it would mix up. So each process's output will flow through a pipe, which we buffer. One subprocess can be directly pi