From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2 3/4] gdbsupport: add async parallel_for_each version
Date: Fri, 19 Sep 2025 16:12:56 -0400 [thread overview]
Message-ID: <6250c19d-e627-498b-8d83-a556b903b2a3@polymtl.ca> (raw)
In-Reply-To: <871po3h8r0.fsf@tromey.com>
On 9/18/25 3:16 PM, Tom Tromey wrote:
>>>>>> "Simon" == simon marchi <simon.marchi@polymtl.ca> writes:
>
> Simon> From: Simon Marchi <simon.marchi@polymtl.ca>
> Simon> New in v2: make the global variable constexpr.
>
> Simon> I would like to use gdb::parallel_for_each to implement the parallelism
> Simon> of the DWARF unit indexing. However, the existing implementation of
> Simon> gdb::parallel_for_each is blocking, which doesn't work with the model
> Simon> used by the DWARF indexer, which is asynchronous and callback-based.
> Simon> Add an asynchronouys version of gdb::parallel_for_each that will be
> Simon> suitable for this task.
>
> Simon> This new version accepts a callback that is invoked when the parallel
> Simon> for each is complete.
>
> This looks good to me.
>
> Simon> + const auto [batch_first, batch_last] = state->queue.pop_batch ();
> Simon> +
> Simon> + if (batch_first == batch_last)
> Simon> + break;
>
> If this was using iterator_range, it'd be easy enough to add an 'empty'
> method to that object.
I did that. I also changed the interface so that the workers receive an
iterator_range, I'll include that in v3.
Simon
next prev parent reply other threads:[~2025-09-19 20:21 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-03 20:01 [PATCH v2 1/4] gdbsupport: use dynamic partitioning in gdb::parallel_for_each simon.marchi
2025-07-03 20:01 ` [PATCH v2 2/4] gdbsupport: factor out work queue from parallel-for.h simon.marchi
2025-09-18 19:07 ` Tom Tromey
2025-09-19 18:06 ` Simon Marchi
2025-07-03 20:01 ` [PATCH v2 3/4] gdbsupport: add async parallel_for_each version simon.marchi
2025-09-18 19:16 ` Tom Tromey
2025-09-19 20:12 ` Simon Marchi [this message]
2025-07-03 20:01 ` [PATCH v2 4/4] gdb/dwarf: use dynamic partitioning for DWARF CU indexing simon.marchi
2025-09-18 19:26 ` Tom Tromey
2025-09-18 19:46 ` Simon Marchi
2025-09-18 19:53 ` Tom Tromey
2025-09-19 20:15 ` Simon Marchi
2025-08-05 17:01 ` [PATCH v2 1/4] gdbsupport: use dynamic partitioning in gdb::parallel_for_each Simon Marchi
2025-08-28 17:00 ` Simon Marchi
2025-09-08 17:23 ` Simon Marchi
2025-09-18 18:59 ` Tom Tromey
2025-09-19 17:47 ` Simon Marchi
2025-09-19 18:04 ` Tom Tromey
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=6250c19d-e627-498b-8d83-a556b903b2a3@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.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