git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCHv6 0/8] fetch submodules in parallel

From
Stefan Beller <sbeller@google.com>
Date
Oct 1, 2015, 19:03 UTC
Message-ID
<CAGZ79kb7Td6v16Ypfp7Uzgh+eLf26Mdwuy6=eMQwkPJdBdMUng@mail.gmail.com>
In-Reply-To
<560D81B7.6090304@ramsayjones.plus.com>

On Thu, Oct 1, 2015 at 11:55 AM, Ramsay Jones <ramsay@ramsayjones.plus.com> wrote:

Show 18 quoted lines
> 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
>
Previous: Ramsay JonesNext: Junio C Hamano
Message 11 of 12 in “[PATCHv6 0/8] fetch submodules in parallel”
  1. Stefan BellerOct 1, 2015
  2. 1/8 submodule.c: write "Fetching submodule <foo>" to stderrStefan Beller, Oct 1, 2015
  3. 2/8 xread: poll on non blocking fdsStefan Beller, Oct 1, 2015
  4. 3/8 xread_nonblock: add functionality to read from fds without blockingStefan Beller, Oct 1, 2015
  5. 4/8 strbuf: add strbuf_read_once to read without blockingStefan Beller, Oct 1, 2015
  6. 5/8 sigchain: add command to pop all common signalsStefan Beller, Oct 1, 2015
  7. 6/8 run-command: add an asynchronous parallel child processorStefan Beller, Oct 1, 2015
  8. 7/8 fetch_populated_submodules: use new parallel job processingStefan Beller, Oct 1, 2015
  9. 8/8 submodules: allow parallel fetching, add tests and documentationStefan Beller, Oct 1, 2015
  10. Ramsay JonesOct 1, 2015
  11. Stefan BellerOct 1, 2015
  12. Junio C HamanoOct 2, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.