Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pedro Alves (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: Tom Tromey <tromey@sourceware.org>, gdb-patches@sourceware.org
Cc: Christian Biesinger <cbiesinger@google.com>
Subject: [review v4] Demangle minsyms in parallel
Date: Tue, 26 Nov 2019 19:06:00 -0000	[thread overview]
Message-ID: <20191126190610.A287320AF6@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1571543710000.I220341f70e94dd02df5dd424272c50a5afb64978@gnutoolchain-gerrit.osci.io>

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 <http://www.gnu.org/licenses/>.  */
| +
| +#ifndef GDBSUPPORT_PARALLEL_FOR_H
| +#define GDBSUPPORT_PARALLEL_FOR_H
| +
| +#include <algorithm>
| +#if CXX_STD_THREAD
| +#include <system_error>

PS3, Line 25:

Is <system_error> necessary?

| +#include <thread>
| +#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<void> 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 <tromey@sourceware.org>
Gerrit-Reviewer: Christian Biesinger <cbiesinger@google.com>
Gerrit-Reviewer: Tom Tromey <tromey@sourceware.org>
Gerrit-CC: Pedro Alves <palves@redhat.com>
Gerrit-Comment-Date: Tue, 26 Nov 2019 19:06:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


  parent reply	other threads:[~2019-11-26 19:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-20  3:55 [review] " Tom Tromey (Code Review)
2019-10-20 11:06 ` Christian Biesinger (Code Review)
2019-10-20 20:55 ` [review v2] " Tom Tromey (Code Review)
2019-10-30 23:00 ` [review v3] " Tom Tromey (Code Review)
2019-11-22 23:45 ` Tom Tromey (Code Review)
2019-11-22 23:56 ` [review v4] " Tom Tromey (Code Review)
2019-11-26 19:06 ` Pedro Alves (Code Review) [this message]
2019-11-26 19:11 ` Pedro Alves (Code Review)
2019-11-26 19:42 ` Tom Tromey (Code Review)
2019-11-26 20:50 ` Tom Tromey (Code Review)
2019-11-26 21:13 ` [pushed] " Sourceware to Gerrit sync (Code Review)
2019-11-26 21:14 ` Sourceware to Gerrit sync (Code Review)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191126190610.A287320AF6@gnutoolchain-gerrit.osci.io \
    --to=gerrit@gnutoolchain-gerrit.osci.io \
    --cc=cbiesinger@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=gnutoolchain-gerrit@osci.io \
    --cc=tromey@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox