Commit Graph

9 Commits

Author SHA1 Message Date
moneromooo-monero 2771a18e85
threadpool: allow leaf functions to run concurrently
Decrease the number of worker threads by one to account
for the fact the calling thread acts as a worker thread now
2018-06-26 22:15:22 +01:00
moneromooo-monero db55263b4c
threadpool: allow constructing an object, and misc tweaks
use unsigned int to avoid having to range check negative numbers,
use const where possible, don't needlessly create empty objects,
use std::move where possible
2018-05-20 12:06:03 +01:00
moneromooo-monero 9b98a6ac8f
threadpool: catch exceptions in dtor, to avoid terminate
If an exception is thrown, it is ignored. While this may hide
a bug, this should only be system exceptions in boost, which
is pretty unlikely. Morever, wait should be called manually
before the dtor anyway. Add an error message if the dtor has
to wait in case some such cases creep in so they get fixed.

Coverity 182538
2018-02-02 16:27:39 +00:00
xmr-eric 84a7f6a482 Readd copyright starting date 2018-01-26 10:03:20 -05:00
xmr-eric 18216f19dd Update 2018 copyright 2018-01-26 10:03:20 -05:00
moneromooo-monero c70e8daa91
threadpool: fix deadlock in recursive waiter usage
If a queued job uses a waiter, then we want to run that waiter's
jobs in the current thread if all threads are busy, even if the
queue is empty, since there is no guarantee that any thread will
free up to take care of that new job, since all the threads might
be running a job which spawns such a recursive job and will block
till that recursive job is done, which it will never be since it
relies on the queue being polled by one of those blocked threads.
2017-12-23 09:00:43 +00:00
Howard Chu 6738753b30
Use max_concurrency as-is
Don't try to 2nd guess user
2017-11-02 16:33:48 +00:00
Howard Chu 6d0ca7d11f
Tweak concurrency limits
Create capacity for 2x max, but lie about it
2017-09-15 00:28:48 +01:00
Howard Chu 510d0d4753
Use a threadpool
Instead of constantly creating and destroying threads
2017-09-14 21:42:48 +01:00