From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id jEbeCzu7zWgY4QoAWB0awg (envelope-from ) for ; Fri, 19 Sep 2025 16:21:15 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=default header.b=rIjltBTB; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 1F69C1E04C; Fri, 19 Sep 2025 16:21:15 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 20C901E04C for ; Fri, 19 Sep 2025 16:21:13 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 382BF3858C39 for ; Fri, 19 Sep 2025 20:21:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 382BF3858C39 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=default header.b=rIjltBTB Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 179663858C56 for ; Fri, 19 Sep 2025 20:13:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 179663858C56 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 179663858C56 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1758312783; cv=none; b=UZPIZB8K1qb9lujmnzD3/tCsmJGrgYSY3gMVnZSqjGaUO2ZT1is6Ic4ivc2mnoRUj0WVxrQjvBsTBVNXc5ra0oqB0zMO+vzZ7OYV3QKz5EOtRJCR+KEURiZXNUQ7Ol3NTu4sBdpgLEFwj/7CKDiTaGiswBP96VTlLygtzm4n7dE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1758312783; c=relaxed/simple; bh=BlrX3qdvlGJ8NDAovOqxyHk3DfWptlIqmD6v1ATvBNo=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=K+GhOBicug/fpcSc7oZC0V9afwZayDBd37NSoXLUlTlyQGkxjKt76ziUqE905Cb6i1Ov9CUfnOXBBz31TdWipFVZLsuhmztBZUA2gH0vEzA2sFO0+g6SEvkiKovNqhXhOvT9DUYr302Cu6KD4vm5lGCvUwC61VgKfew0/sJrXOY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 179663858C56 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 58JKCvDl116889 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 Sep 2025 16:13:02 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 58JKCvDl116889 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1758312782; bh=Pdl8hxM48DYRCCxfHbww64SlfpmM5cVCCWmYJz4N0C8=; h=Date:Subject:To:Cc:From:In-Reply-To:From; b=rIjltBTBborTPflNIxoB2Nyjd2QCvhH8ADxQVh/9Kpw35UDp0a1n5hRub7/hoL7YX nCzu3XvjF6GJz2iLqxvgzuluPs2X57P4Oiae4TuU4aY4SyqLcPlEQSNiugbYvIyYE9 RjJcP0TRVaz1w1vGADfJj8IuL64WneQlium+oTqk= Received: by simark.ca (Postfix) id 2F8021E04C; Fri, 19 Sep 2025 16:12:57 -0400 (EDT) Message-ID: <6250c19d-e627-498b-8d83-a556b903b2a3@polymtl.ca> Date: Fri, 19 Sep 2025 16:12:56 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/4] gdbsupport: add async parallel_for_each version To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20250703200130.4095761-1-simon.marchi@polymtl.ca> <20250703200130.4095761-3-simon.marchi@polymtl.ca> <871po3h8r0.fsf@tromey.com> Content-Language: fr From: Simon Marchi In-Reply-To: <871po3h8r0.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 19 Sep 2025 20:12:57 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 9/18/25 3:16 PM, Tom Tromey wrote: >>>>>> "Simon" == simon marchi writes: > > Simon> From: Simon Marchi > 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