From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 97913 invoked by alias); 26 Nov 2019 19:06:15 -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 97900 invoked by uid 89); 26 Nov 2019 19:06:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT autolearn=ham version=3.3.1 spammy=subranges 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; Tue, 26 Nov 2019 19:06:13 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id DA1EA20413; Tue, 26 Nov 2019 14:06:11 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [IPv6:2620:52:3:1:5054:ff:fe06:16ca]) by mx1.osci.io (Postfix) with ESMTP id C7C802012A; Tue, 26 Nov 2019 14:06:10 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id A287320AF6; Tue, 26 Nov 2019 14:06:10 -0500 (EST) X-Gerrit-PatchSet: 4 Date: Tue, 26 Nov 2019 19:06:00 -0000 From: "Pedro Alves (Code Review)" To: Tom Tromey , gdb-patches@sourceware.org Cc: Christian Biesinger Auto-Submitted: auto-generated X-Gerrit-MessageType: comment Subject: [review v4] Demangle minsyms in parallel X-Gerrit-Change-Id: I220341f70e94dd02df5dd424272c50a5afb64978 X-Gerrit-Change-Number: 173 X-Gerrit-ChangeURL: X-Gerrit-Commit: 8d2c69ea050b6f3bac49715e144d3661a66d21ab In-Reply-To: References: X-Gerrit-Comment-Date: Tue, 26 Nov 2019 14:06:10 -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: <20191126190610.A287320AF6@gnutoolchain-gerrit.osci.io> X-SW-Source: 2019-11/txt/msg00911.txt.bz2 Pedro Alves has posted comments on this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/173 ...................................................................... Patch Set 4: (2 comments) Sending these review comments I had on patchset 3. I'll take a look at v4. | --- /dev/null | +++ gdb/gdbsupport/parallel-for.h | @@ -1,0 +16,19 @@ /* Parallel for loops | + | + You should have received a copy of the GNU General Public License | + along with this program. If not, see . */ | + | +#ifndef GDBSUPPORT_PARALLEL_FOR_H | +#define GDBSUPPORT_PARALLEL_FOR_H | + | +#include | +#if CXX_STD_THREAD | +#include PS3, Line 25: Is necessary? | +#include | +#include "gdbsupport/thread-pool.h" | +#endif | + | +namespace gdb | +{ | + | +/* A very simple "parallel for". This splits the range of iterators | + into subranges, and then passes each subrange to the callback. The ... | @@ -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: This "2 * n_threads <= n_elements" gave me pause. I think it warrants a comment. (I see you've addressed this already.) | + { | + 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: 4 Gerrit-Owner: Tom Tromey Gerrit-Reviewer: Christian Biesinger Gerrit-Reviewer: Tom Tromey Gerrit-CC: Pedro Alves Gerrit-Comment-Date: Tue, 26 Nov 2019 19:06:10 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment