From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id t1WSLGGXzWjXvAoAWB0awg (envelope-from ) for ; Fri, 19 Sep 2025 13:48:17 -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=BuYxUMza; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9E2DB1E04C; Fri, 19 Sep 2025 13:48:17 -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 A180B1E04C for ; Fri, 19 Sep 2025 13:48:16 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 14DAF3858401 for ; Fri, 19 Sep 2025 17:48:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14DAF3858401 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=BuYxUMza Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id BFF743858D20 for ; Fri, 19 Sep 2025 17:47:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BFF743858D20 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 BFF743858D20 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=1758304062; cv=none; b=lc/kCB9vkQiNdYEL11dx/t477Mq4BYfvjeAmSBufGx14wLWTlxQ/zrh8tgsY5Pstrkk2jYC78Tq9Q70yNKM5E0x14pSU4MgXZOdQb4LD6lDDQvdX8QcUCALF5LTWwKf0PhGW/WiaBZmVi/XSNibPiLBgWnIbKLkz907YR+PnBLE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1758304062; c=relaxed/simple; bh=FXiZYptIpMTKbrXNqgxFBpHz4KUKrB1kPoFIKV61WQw=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=j/WTIN/bEPwULiZFzjWLig7RQMPvXtgY35suYyfyvcRyhCVGhvi2QBxGfrvTtVKqExvyfEMkM50ibu7kR+V1waySkkwvaqYPKpzR/Q9Fhp4/KnkOT6jX3nfMyPoUVgKu9pHL+17RU2sP1+tGGvfM6QuP3J27brUs8CnThSL6sV4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BFF743858D20 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 58JHlb5B056392 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 Sep 2025 13:47:41 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 58JHlb5B056392 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1758304062; bh=AHVCYERklp1BwEFo6viP2LcREB72tC7E9f6vE2sGzsc=; h=Date:Subject:To:Cc:From:In-Reply-To:From; b=BuYxUMza1aREDgPyZSNTFTSOpvILUxdjoHcJsX0iFs5lZgzmYcZu2Jh+7rNgC8KgB XmM6hH30qL/V13mA8vEpEIrfSgHT3+NWgsQKe7p8MQ5yDQR6DUF9/2zQzzLSMFY+P4 ooS6nCoRBD8tG/t1uAHLxD0QpIRCXvmzc0ftZ+Yw= Received: by simark.ca (Postfix) id A504F1E04C; Fri, 19 Sep 2025 13:47:36 -0400 (EDT) Message-ID: <3d46fcb8-745f-4e0c-9de0-b27251bb37a3@polymtl.ca> Date: Fri, 19 Sep 2025 13:47:36 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/4] gdbsupport: use dynamic partitioning in gdb::parallel_for_each To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20250703200130.4095761-1-simon.marchi@polymtl.ca> <87frcjh9iz.fsf@tromey.com> Content-Language: fr From: Simon Marchi In-Reply-To: <87frcjh9iz.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 17:47:37 +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 2:59 PM, Tom Tromey wrote: >>>>>> "Simon" == simon marchi writes: > > Simon> From: Simon Marchi > Simon> gdb::parallel_for_each uses static partitioning of the workload, meaning > Simon> that each worker thread receives a similar number of work items. Change > Simon> it to use dynamic partitioning, where worker threads pull work items > Simon> from a shared work queue when they need to. > > Finally getting back to this. > > Simon> Note that gdb::parallel_for_each is currently only used for processing > Simon> minimal symbols in GDB. I am looking at improving the startup > Simon> performance of GDB, where the minimal symbol process is one step. > > I do wonder if this functionality should just be intrinsic to > thread-pool somehow, like separate the notions of a "task" and a "job > queue". I think you'll have to talk me through it, because I don't immediately see what you mean (perhaps because it's been a while since I worked on this). > But anyway I think we should move forward with what exists. > > Simon> + auto task = > Simon> + [&next, first, last, n_worker_threads, &args_tuple] () { > > I think the "{" should go on the next line. Ok, changed it to: auto task = [&next, first, last, n_worker_threads, &args_tuple] () { /* Instantiate the user-defined worker. */ auto worker = std::make_from_tuple (args_tuple); > Approved-By: Tom Tromey Thanks, Simon