[review v4] Add maint set/show worker-threads

Pedro Alves (Code Review) gerrit@gnutoolchain-gerrit.osci.io
Tue Nov 26 19:18:00 GMT 2019


Pedro Alves has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/174
......................................................................


Patch Set 4: Code-Review+2

(1 comment)

Minor comment below, but otherwise LGTM.

| --- gdb/maint.c
| +++ gdb/maint.c
| @@ -843,0 +854,19 @@ update_thread_pool_size ()
| +#if CXX_STD_THREAD
| +  int n_threads = n_worker_threads;
| +
| +  if (n_threads < 0)
| +    {
| +      n_threads = std::thread::hardware_concurrency ();
| +      if (n_threads == 0)
| +	{
| +	  /* Meh.  */
| +	  n_threads = 2;

PS4, Line 863:

If we have no concurrency, then shouldn't we fallback to no extra
threads?  Presumably the threads in the poll will be running CPU-bound
code, so more threads in the same hardware core/thread won't help,
right?

BTW, JIC, did you check if setting the number of threads to 0 behaves
OK?

| +	}
| +    }
| +
| +  gdb::thread_pool::g_thread_pool->set_thread_count (n_threads);
| +#endif
| +}
| +
| +static void
| +maintenance_set_worker_threads (const char *args, int from_tty,

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I4fb514faa05879d8afe62c77036a4469d57dca2a
Gerrit-Change-Number: 174
Gerrit-PatchSet: 4
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-Reviewer: Pedro Alves <palves@redhat.com>
Gerrit-CC: Christian Biesinger <cbiesinger@google.com>
Gerrit-Comment-Date: Tue, 26 Nov 2019 19:18:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment



More information about the Gdb-patches mailing list