Subject: Re: [PATCH 3/5] submodule: helper to run foreach in parallel

From: Junio C Hamano <[email-masked]>
Date: Tue, 25 Aug 2015 15:44:09 -0700

Junio C Hamano <[email-masked]> writes:

>> Why would we want to unplug the task queue from somewhere else?
>
> When you have a dispatcher more intelligent than a stupid FIFO, I
> would imagine that you would want to be able to do this pattern,
> especially when coming up with a task (not performing a task) takes
> non-trivial amount of work:
>
> 	prepare task queue and have N threads waiting on it;
>
> 	plug the queue, i.e. tell threads that do not start picking
> 	tasks out of it yet;

s/that do not/not to/; sorry for grammo resulting from a lot of
editing while doing other things X-<.

> ...
>       and finally, wait for everything to finish.
>
> Without "plug/unplug" interface, you _could_ do the above by doing
> something stupid like
> ...
>       and finally, wait for everything to finish.

... but having to use yet another queue outside only because the
task queue cannot be plugged feels stupid.

But because we do not yet have a way to plug custom dispatching
logic to the dispatcher, the above is in the "but that can wait
until the need arises." category, as I said.