From: Stefan Beller <sbeller@google.com>
To: Ramsay Jones <ramsay@ramsayjones.plus.com>
Cc: Junio C Hamano <gitster@pobox.com>,
"git@vger.kernel.org" <git@vger.kernel.org>,
Jacob Keller <jacob.keller@gmail.com>, Jeff King <peff@peff.net>,
Jonathan Nieder <jrnieder@gmail.com>,
Johannes Schindelin <johannes.schindelin@gmail.com>,
Jens Lehmann <Jens.Lehmann@web.de>,
Eric Sunshine <ericsunshine@gmail.com>
Subject: Re: [PATCHv6 0/8] fetch submodules in parallel
Date: Thu, 1 Oct 2015 12:03:41 -0700 [thread overview]
Message-ID: <CAGZ79kb7Td6v16Ypfp7Uzgh+eLf26Mdwuy6=eMQwkPJdBdMUng@mail.gmail.com> (raw)
In-Reply-To: <560D81B7.6090304@ramsayjones.plus.com>
On Thu, Oct 1, 2015 at 11:55 AM, Ramsay Jones
<ramsay@ramsayjones.plus.com> wrote:
> Hi Stefan,
>
>>
>> - if (!pp->get_next_task(pp->data,
>> + if (!pp->get_next_task(&pp->children[i].data,
>> &pp->children[i].process,
>> - &pp->children[i].err))
>> + &pp->children[i].err,
>> + pp->data))
>> return 1;
>
> ... the above hunk caught my eye. I don't know that it matters that
> much, but since you have reordered parameters on some functions, should
> pp->get_next_task() take the 'task_cb' as the last parameter, rather than
> the first?
>
> I have not looked at the final result yet (just the interdiff), so please
> just ignore the above if I've missed something obvious. :-D
Well I reordered such that "passive" arguments come last, i.e. the
cookies for consumption. In this specific case we ask get_next_task
to fill in the cookie if desired. Unlike all the other cookie passing
this is a double void pointer, so even syntactically we have a difference
to other cookie passing around.
If you look at the function definitions in the header, you find the arguments
ordered as
(Active/unique arguments for that function, child process, error
buffer, cookies for consumption)
That said, I find a few things I need to improve.
pp->children[i].data, may want to be initialized to NULL before we ask
get_next_task
to fill in a cookie. If get_next_task decides not to, we have a clear default.
The call to run_processes_parallel may be reordered to its original order again,
as we pass in a cookie actively. (int n, int *cb, callbacks...)
>
> ATB,
> Ramsay Jones
>
next prev parent reply other threads:[~2015-10-01 19:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-01 1:54 [PATCHv6 0/8] fetch submodules in parallel Stefan Beller
2015-10-01 1:54 ` [PATCHv6 1/8] submodule.c: write "Fetching submodule <foo>" to stderr Stefan Beller
2015-10-01 1:54 ` [PATCHv6 2/8] xread: poll on non blocking fds Stefan Beller
2015-10-01 1:54 ` [PATCHv6 3/8] xread_nonblock: add functionality to read from fds without blocking Stefan Beller
2015-10-01 1:54 ` [PATCHv6 4/8] strbuf: add strbuf_read_once to read " Stefan Beller
2015-10-01 1:54 ` [PATCHv6 5/8] sigchain: add command to pop all common signals Stefan Beller
2015-10-01 1:54 ` [PATCHv6 6/8] run-command: add an asynchronous parallel child processor Stefan Beller
2015-10-01 1:54 ` [PATCHv6 7/8] fetch_populated_submodules: use new parallel job processing Stefan Beller
2015-10-01 1:54 ` [PATCHv6 8/8] submodules: allow parallel fetching, add tests and documentation Stefan Beller
2015-10-01 18:55 ` [PATCHv6 0/8] fetch submodules in parallel Ramsay Jones
2015-10-01 19:03 ` Stefan Beller [this message]
2015-10-02 18:48 ` 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='CAGZ79kb7Td6v16Ypfp7Uzgh+eLf26Mdwuy6=eMQwkPJdBdMUng@mail.gmail.com' \
--to=sbeller@google.com \
--cc=Jens.Lehmann@web.de \
--cc=ericsunshine@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jacob.keller@gmail.com \
--cc=johannes.schindelin@gmail.com \
--cc=jrnieder@gmail.com \
--cc=peff@peff.net \
--cc=ramsay@ramsayjones.plus.com \
/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).