Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
Cc: Tom Tromey <tom@tromey.com>, Pedro Alves <pedro@palves.net>
Subject: Re: [PATCH][gdbsupport] Use task size in parallel_for_each
Date: Fri, 22 Jul 2022 13:08:25 -0600	[thread overview]
Message-ID: <87leslj786.fsf@tromey.com> (raw)
In-Reply-To: <75931310-5dcd-059d-9221-6c94dbcd231f@suse.de> (Tom de Vries via Gdb-patches's message of "Thu, 21 Jul 2022 22:23:33 +0200")

Pedro> My passerby comment is that I wonder whether we should consider
Pedro> switching to a work stealing implementation, so that threads that
Pedro> are done with their chunk would grab another chunk from the work
Pedro> pool.  I think this would spare us from having to worry about
Pedro> these distribution heuristics.

Tom> I also though about a dynamic solution, but decided to try the
Tom> simplest solution first.

Tom> Anyway, with a dynamic solution you still might want to decide how big
Tom> a chunck is, for which you could still need this type of heuristics.

I think the idea of the work-stealing approach is that each worker grabs
work as it can, and so no sizing is needed at all.  If one worker ends
up with a very large CU, it will simply end up working on fewer CUs.

In this situation, work stealing might make the overall implementation
simpler.  Perhaps the batching parameter patch (commit 82d734f7a) and
the vector of results patch (commit f4565e4c9) could be removed.

Then, rather than using parallel_for, the DWARF reader could send N jobs
to the thread pool, and each job would simply take the next available CU
by incrementing an atomic counter.  When the counter reached the number
of CUs, a job would stop.

Tom

  parent reply	other threads:[~2022-07-22 19:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-18 19:42 Tom de Vries via Gdb-patches
2022-07-21 17:35 ` Pedro Alves
2022-07-21 20:23   ` Tom de Vries via Gdb-patches
2022-07-22  0:03     ` Pedro Alves
2022-07-22 11:07       ` Pedro Alves
2022-07-22 17:07       ` Tom de Vries via Gdb-patches
2022-07-22 19:08     ` Tom Tromey [this message]
2022-07-22 19:38       ` Simon Marchi via Gdb-patches
2022-07-23  3:17         ` Tom Tromey
2022-07-22 21:21       ` Tom Tromey
2022-07-23  6:51         ` Tom de Vries via Gdb-patches
2022-07-31  8:38           ` Tom de Vries via Gdb-patches
2022-07-23  5:55       ` Tom de Vries via Gdb-patches

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=87leslj786.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    /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