From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109774 invoked by alias); 22 Nov 2019 23:45:47 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 109691 invoked by uid 89); 22 Nov 2019 23:45:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 22 Nov 2019 23:45:40 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id DBBA220250; Fri, 22 Nov 2019 18:45:38 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id 817B1202EB; Fri, 22 Nov 2019 18:45:37 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 2488E2816F; Fri, 22 Nov 2019 18:45:36 -0500 (EST) X-Gerrit-PatchSet: 3 Date: Fri, 22 Nov 2019 23:45:00 -0000 From: "Tom Tromey (Code Review)" To: gdb-patches@sourceware.org Cc: Christian Biesinger Auto-Submitted: auto-generated X-Gerrit-MessageType: comment Subject: [review v3] Demangle minsyms in parallel X-Gerrit-Change-Id: I220341f70e94dd02df5dd424272c50a5afb64978 X-Gerrit-Change-Number: 173 X-Gerrit-ChangeURL: X-Gerrit-Commit: bbdb2c22c003dabced484365542938aa0dd2d7f1 In-Reply-To: References: X-Gerrit-Comment-Date: Fri, 22 Nov 2019 18:45:35 -0500 Reply-To: gnutoolchain-gerrit@osci.io MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Content-Type: text/plain; charset=UTF-8 Message-Id: <20191122234536.2488E2816F@gnutoolchain-gerrit.osci.io> X-SW-Source: 2019-11/txt/msg00760.txt.bz2 Tom Tromey has posted comments on this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/173 ...................................................................... Patch Set 3: (1 comment) | --- /dev/null | +++ gdb/gdbsupport/parallel-for.h | @@ -1,0 +45,19 @@ parallel_for_each (RandomIt first, RandomIt last, RangeFunction callback) | +#if CXX_STD_THREAD | + /* So we can use a local array below. */ | + const size_t local_max = 16; | + size_t n_threads = std::min (thread_pool::g_thread_pool->count (), | + local_max); | + size_t n_actual_threads = 0; | + std::future futures[local_max]; | + | + size_t n_elements = last - first; | + if (n_threads > 1 && 2 * n_threads <= n_elements) PS3, Line 54: I think this check doesn't really make sense -- if one has many elements but also many threads available, the answer shouldn't be to give up. In the next revision, I've changed it to reduce the number of threads used when there aren't many elements per thread. I picked an arbitrary cutoff of a minimum of 10 elements. | + { | + size_t elts_per_thread = n_elements / n_threads; | + n_actual_threads = n_threads - 1; | + for (int i = 0; i < n_actual_threads; ++i) | + { | + RandomIt end = first + elts_per_thread; | + auto task = [=] () | + { | + callback (first, end); -- Gerrit-Project: binutils-gdb Gerrit-Branch: master Gerrit-Change-Id: I220341f70e94dd02df5dd424272c50a5afb64978 Gerrit-Change-Number: 173 Gerrit-PatchSet: 3 Gerrit-Owner: Tom Tromey Gerrit-Reviewer: Christian Biesinger Gerrit-Reviewer: Tom Tromey Gerrit-Comment-Date: Fri, 22 Nov 2019 23:45:35 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment