From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 50BFB3857BBD for ; Fri, 15 Jul 2022 16:44:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 50BFB3857BBD Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 82F5934EA8; Fri, 15 Jul 2022 16:44:34 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 61BE813754; Fri, 15 Jul 2022 16:44:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id rN+oFnKZ0WK9dgAAMHmgww (envelope-from ); Fri, 15 Jul 2022 16:44:34 +0000 Message-ID: Date: Fri, 15 Jul 2022 18:44:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH][gdbsupport] Add sequential_for_each Content-Language: en-US To: Tom Tromey , Tom de Vries via Gdb-patches References: <20220625132042.GA31575@delia.com> <87r12mpbz9.fsf@tromey.com> From: Tom de Vries In-Reply-To: <87r12mpbz9.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2022 16:44:41 -0000 On 7/15/22 18:38, Tom Tromey wrote: > Tom> Add a sequential_for_each alongside the parallel_for_each, which can be used > Tom> as a drop-in replacement. > > Tom> This can be useful when debugging multi-threading behaviour, and you want to > Tom> limit multi-threading in a fine-grained way. > > It's not fine-grained but I typically just set the number of worker > threads to 0. FWIW, the use case I'm using it for atm is developing some code that introduces a new parallel_for_each, and then switching some existing parallel_for_each back to sequential to limit the race conditions I'm going to run into to a certain scope. Thanks, - Tom