Re: [PATCHv3 06/13] run-command: add an asynchronous parallel child processor

2015-09-22 Thread Junio C Hamano
Stefan Beller writes: > So how would you find out when we are done? while (1) { if (we have available slot) ask to start a new one; if (nobody is running anymore) break;

Re: [PATCHv3 06/13] run-command: add an asynchronous parallel child processor

2015-09-22 Thread Stefan Beller
On Mon, Sep 21, 2015 at 6:08 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> +void default_start_failure(void *data, >> +struct child_process *cp, >> +struct strbuf *err) >> +{ >> + int i; >> +

Re: [PATCHv3 06/13] run-command: add an asynchronous parallel child processor

2015-09-22 Thread Stefan Beller
On Tue, Sep 22, 2015 at 12:53 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> So how would you find out when we are done? > > while (1) { > if (we have available slot) > ask to start a new one; >

Re: [PATCHv3 06/13] run-command: add an asynchronous parallel child processor

2015-09-22 Thread Stefan Beller
On Tue, Sep 22, 2015 at 2:41 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> On Tue, Sep 22, 2015 at 12:53 PM, Junio C Hamano wrote: >>> Stefan Beller writes: >>> So how would you find out when we are

Re: [PATCHv3 06/13] run-command: add an asynchronous parallel child processor

2015-09-22 Thread Junio C Hamano
Stefan Beller writes: > On Tue, Sep 22, 2015 at 12:53 PM, Junio C Hamano wrote: >> Stefan Beller writes: >> >>> So how would you find out when we are done? >> >> while (1) { >> if (we have available slot) >>

Re: [PATCHv3 06/13] run-command: add an asynchronous parallel child processor

2015-09-22 Thread Junio C Hamano
Stefan Beller writes: > On Tue, Sep 22, 2015 at 2:41 PM, Junio C Hamano wrote: >> Stefan Beller writes: >> >>> On Tue, Sep 22, 2015 at 12:53 PM, Junio C Hamano wrote: Stefan Beller writes:

[PATCHv3 06/13] run-command: add an asynchronous parallel child processor

2015-09-21 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

Re: [PATCHv3 06/13] run-command: add an asynchronous parallel child processor

2015-09-21 Thread Junio C Hamano
Stefan Beller writes: > +void default_start_failure(void *data, > +struct child_process *cp, > +struct strbuf *err) > +{ > + int i; > + struct strbuf sb = STRBUF_INIT; > + > + for (i = 0; cp->argv[i]; i++) > +