Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@efficios.com>
To: Tom Tromey <tom@tromey.com>, simon.marchi@polymtl.ca
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2 4/4] gdb/dwarf: use dynamic partitioning for DWARF CU indexing
Date: Thu, 18 Sep 2025 15:46:31 -0400	[thread overview]
Message-ID: <ef729ee5-9599-4051-aa57-40fc28173ed1@efficios.com> (raw)
In-Reply-To: <87tt0zftoq.fsf@tromey.com>

On 9/18/25 3:26 PM, Tom Tromey wrote:
>>>>>> "Simon" == simon marchi <simon.marchi@polymtl.ca> writes:
> 
> Simon> +  /* Launch parallel tasks to index units.  */
> Simon> +  gdb::parallel_for_each_async<1, dwarf2_per_cu_up *, parallel_indexing_worker>
> Simon> +    (per_bfd->all_units.data (),
> Simon> +     per_bfd->all_units.data () + per_bfd->all_units.size (),
> Simon> +     [this] () { this->done_reading (); }, "DWARF indexing worker", this);
> Simon>  }
>  
> I was curious to know why this uses .data() rather than iterators.
> 
> Tom

Yeah, that's unfortunate.  It's because
std::atomic<std::vector<...>::iterator> won't work with
-D_GLIBCXX_DEBUG.  If I try to use iterators all the way, I get:

/opt/gcc/15.2.0/include/c++/15.2.0/atomic:214:21: error: static assertion failed: std::atomic requires a trivially copyable type
  214 |       static_assert(__is_trivially_copyable(_Tp),
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Without _GLIBCXX_DEBUG, vector iterators boil down to just a pointer.
But with _GLIBCXX_DEBUG, there is additional state.

I still want to be able to use _GLIBCXX_DEBUG, it's pretty useful.

Simon

  reply	other threads:[~2025-09-18 19:47 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
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 [this message]
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=ef729ee5-9599-4051-aa57-40fc28173ed1@efficios.com \
    --to=simon.marchi@efficios.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    --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