git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stefan Beller <sbeller@google.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>,
	Heiko Voigt <hvoigt@hvoigt.net>,
	Jens Lehmann <jens.lehmann@web.de>
Subject: Re: [PATCH] Add fetch.recurseSubmoduleParallelism config option
Date: Tue, 13 Oct 2015 09:03:24 -0700	[thread overview]
Message-ID: <CAGZ79kYZ+RyjvkgY8+aeRpnVtaCyqFxQqQ3wggjtef7y6MNLcA@mail.gmail.com> (raw)
In-Reply-To: <xmqqzizn9qaf.fsf@gitster.mtv.corp.google.com>

On Tue, Oct 13, 2015 at 12:32 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Stefan Beller <sbeller@google.com> writes:
>
>>> The parallel_process API could learn a new "verbose" feature that it
>>> by itself shows some messages like
>>>
>>>     "processing the 'frotz' job with N tasks"
>>>     "M tasks finished (N still running)"
>>
>> I know what to fill in for M and N, 'frotz' is a bit unclear to me.
>
> At least I don't know what M and N should be, and I'm curious how
> you'll define them.  See below.

I presumed the second school of thought. Another alternative there would
be to have 3 numbers:

    "M tasks finished (N still running, K pending output)"

>
>>> in the output stream from strategic places.  For example, the first
>>> message will come at the end of pp_init(), and the second message
>>> will be appended at the end of buffered output of a task that has
>>> just been finished.  Once you have something like that, you could
>>> check for them in a test in t/.
>>>
>>> Just a thought.
>>
>> I like that thought. :)
>
>
> A few more random thoughts:
>
>  * The only thing you could rely on if you were to use the above in
>    your tests is the one from pp_init() that declares how many
>    processes the machinery is going to use.  M/N will be unstable,
>    depending on the scheduling order (e.g. the foreground process
>    may take a lot of time to finish, while many other processes
>    finish first).
>
>  * Every time the foreground process (i.e. the one whose output is
>    tee-ed to the overall output from the machinery) finishes, you
>    can emit "M tasks finished (N still running)", but I am not sure
>    what M should be.  It is debatable how to account for background
>    processes that have already completed but whose output haven't
>    been shown.

Assuming we go with your second school of thought (N are the real
running processes, M including the finished but still pending output tasks),
we may have confusing output, as the output order may confuse the
reader:

    N=8 M=13 (output from live task)
    ...
    N=8 M=12 (output from buffered task)
    ...

Anyone who has no knowledge of the internals, wonders why
M goes *down* ?

>
>    One school of thought that is in line with the "pretend as if the
>    background tasks are started immediately after the foreground
>    task finishes, and they run at infinite speed and produce output
>    in no time" idea, on which the "queue output from the background
>    processes and emit at once in order to avoid intermixing" design
>    was based on, would be not to include them in M (i.e. finished
>    ones), because their output haven't been emitted and we are
>    pretending that they haven't even been started.  If you take this
>    approach, you however may have to include them in N (i.e. still
>    running), but that would likely bump N beyond the maximum number
>    of simultaneous processes.
>
>    The other school of thought would of course tell the truth and
>    include the number of finished background processes in M, as they
>    have finished already in the reality.  This will not risk showing
>    N that is beyond the maximum, but your first "progress" output
>    might say "3 tasks finished", which will make it look odd in a
>    different way.
>

  reply	other threads:[~2015-10-13 16:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-12 22:52 [PATCH] Add fetch.recurseSubmoduleParallelism config option Stefan Beller
2015-10-12 23:14 ` Junio C Hamano
2015-10-12 23:31   ` Stefan Beller
2015-10-12 23:50     ` Junio C Hamano
2015-10-16 17:04       ` Stefan Beller
2015-10-16 17:26         ` Junio C Hamano
2015-10-13  7:32     ` Junio C Hamano
2015-10-13 16:03       ` Stefan Beller [this message]
2015-10-13 21:07         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGZ79kYZ+RyjvkgY8+aeRpnVtaCyqFxQqQ3wggjtef7y6MNLcA@mail.gmail.com \
    --to=sbeller@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hvoigt@hvoigt.net \
    --cc=jens.lehmann@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).