From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: Jens Lehmann <Jens.Lehmann@web.de>,
Heiko Voigt <hvoigt@hvoigt.net>,
"git\@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCH] submodule: implement `module_name` as a builtin helper
Date: Fri, 07 Aug 2015 17:21:30 -0700 [thread overview]
Message-ID: <xmqqlhdmwrxx.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAGZ79kaGe59=z4Eeuno8DRuWWRD12OyLETi7NA+utfoLsJ4+=A@mail.gmail.com> (Stefan Beller's message of "Fri, 7 Aug 2015 16:19:25 -0700")
Stefan Beller <sbeller@google.com> writes:
>> One more thing, as I didn't notice that you kept repeating "thread"
>> pool API.
>
> Yeah I intended to use both threads and processes for the heavy submodule
> operations.
OK. I somehow had an impression that it might be more tricky than
it is worth to spawn/run_command out of a thread/run_async, but if
it makes it easier and more generic to correctly arrange the
thread-pool API to allow the per-thread functions to run_command(),
I wouldn't object to that approach at all.
Then for-each-parallel would truly become a trivial application of
that API. Your per-thread function happens to be a one that
prepares appropriate "struct child_process" and calls run_command()
to interact with that single child, receiving its output and culling
it when it is done.
>> ... if
>> you really want to go the "thread" route, the first thing to try
>> would be to see if a few places we already use threads for
>> parallelism (namely, "grep", "pack-objects", "preload-index" and
>> "index-pack") can be factored out and model your new API around the
>> commonality among them.
And obviously, doing your pool API around threads will allow you to
throw future per-thread function that do not involve run_command()
at all at your API, and it will make it easy to adapt the current
threaded parts of the system to the API.
Perfect.
;-)
next prev parent reply other threads:[~2015-08-08 0:21 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-05 0:04 [PATCH 1/4] submodule: implement `module_list` as a builtin helper Stefan Beller
2015-08-05 0:04 ` [PATCH 2/4] submodule: implement `module_name` " Stefan Beller
2015-08-05 0:05 ` Stefan Beller
2015-08-05 0:58 ` Eric Sunshine
2015-08-05 16:29 ` Stefan Beller
2015-08-05 19:06 ` Jens Lehmann
2015-08-05 19:55 ` Stefan Beller
2015-08-05 21:08 ` [PATCH] " Stefan Beller
2015-08-06 19:49 ` Jens Lehmann
2015-08-06 21:38 ` Stefan Beller
2015-08-07 20:03 ` Junio C Hamano
2015-08-07 20:54 ` Stefan Beller
2015-08-07 20:17 ` Junio C Hamano
2015-08-07 20:49 ` Stefan Beller
2015-08-07 21:14 ` Junio C Hamano
2015-08-07 21:21 ` Stefan Beller
2015-08-07 21:32 ` Junio C Hamano
2015-08-07 22:04 ` Stefan Beller
2015-08-07 22:18 ` Junio C Hamano
2015-08-07 23:12 ` Stefan Beller
2015-08-07 22:42 ` Junio C Hamano
2015-08-07 23:19 ` Stefan Beller
2015-08-08 0:21 ` Junio C Hamano [this message]
2015-08-08 6:20 ` Junio C Hamano
2015-08-10 17:03 ` Stefan Beller
2015-08-05 18:31 ` [PATCH 1/4] submodule: implement `module_list` " Jens Lehmann
2015-08-07 19:53 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqlhdmwrxx.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=Jens.Lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=hvoigt@hvoigt.net \
--cc=sbeller@google.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.
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 NNTP newsgroup(s).