public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Johannes Schindelin <johannes.schindelin@gmx•de>
Cc: Stefan Beller <sbeller@google•com>,
	git@vger•kernel.org, peff@peff•net, jrnieder@gmail•com
Subject: Re: [PATCH 2/5] thread-utils: add a threaded task queue
Date: Fri, 28 Aug 2015 08:34:49 -0700	[thread overview]
Message-ID: <xmqq1ten4eau.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <a35977776a7ea97b0ddd4d1921e3e95f@www.dscho.org> (Johannes Schindelin's message of "Thu, 27 Aug 2015 14:59:33 +0200")

Johannes Schindelin <johannes.schindelin@gmx•de> writes:

>> +void add_task(struct task_queue *tq,
>> +	      int (*fct)(struct task_queue *tq, void *task),
>
> Might make sense to typedef this... Maybe task_t?

Let's not introduce user defined type that ends with _t that is seen
globally.

>> +	      void *task)
>> +{
>> +	if (tq->early_return)
>> +		return;
>
> Ah, so "early_return" actually means "interrupted" or "canceled"?
>
> I guess I will have to set aside some time to wrap my head around the
> way tasks are handled here, in particular how the two `early_return`
> variables (`dispatcher()`'s local variable and the field in the
> task_queue`) interact.

We had a very similar conversation in $gmane/276324 as the
early-return and get_task interaction was not quite intuitive.

I thought Stefan said something about this part of the logic being
unreadable and needs rework.  Perhaps that will come in the next
reroll, or something?

I tend to agree with you that interrupted or cancelled would be a
good name for this thing; at least it would help understanding what
is going on than "early-return".

Thanks.

  parent reply	other threads:[~2015-08-28 15:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-27  0:52 [RFC PATCH 0/5] Progressing with `git submodule foreach_parallel` Stefan Beller
2015-08-27  0:52 ` [PATCH 1/5] submodule: implement `module_clone` as a builtin helper Stefan Beller
2015-08-27 12:36   ` Johannes Schindelin
2015-08-27 21:57     ` Stefan Beller
2015-08-27  0:52 ` [PATCH 2/5] thread-utils: add a threaded task queue Stefan Beller
2015-08-27 12:59   ` Johannes Schindelin
2015-08-27 17:02     ` Stefan Beller
2015-08-28 15:34     ` Junio C Hamano [this message]
2015-08-27  0:52 ` [PATCH 3/5] submodule: helper to run foreach in parallel Stefan Beller
2015-08-27  0:52 ` [PATCH 4/5] index-pack: Use the new worker pool Stefan Beller
2015-08-27  0:52 ` [PATCH 5/5] pack-objects: Use " Stefan Beller
  -- strict thread matches above, loose matches on Subject: below --
2015-08-25 17:28 [RFC PATCH 0/5] Demonstrate new parallel threading API Stefan Beller
2015-08-25 17:28 ` [PATCH 2/5] thread-utils: add a threaded task queue Stefan Beller

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=xmqq1ten4eau.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=johannes.schindelin@gmx$(echo .)de \
    --cc=jrnieder@gmail$(echo .)com \
    --cc=peff@peff$(echo .)net \
    --cc=sbeller@google$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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