aboutsummaryrefslogtreecommitdiff
path: root/src/common/threadpool.cpp (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-03-04Copyright: Update to 2022mj-xmr1-1/+1
2020-09-01threadpool: guard against exceptions in jobs, and armour platingmoneromooo-monero1-5/+6
Those would, if uncaught, exit run and leave the waiter to wait indefinitely for the number of active jobs to reach 0
2020-05-06Update copyright year to 2020SomaticFanatic1-1/+1
Update copyright year to 2020
2020-02-12threadpool: lock mutex in createmoneromooo-monero1-0/+1
In some contrived case, it might theoretically be the case that destroy is called from another thread, which would modify the threads array from two threads. Coverity 208372
2020-01-16Merge pull request #6141Alexander Blair1-1/+1
b9b5c473 threadpool: use std::move when taking an element off the queue (moneromooo-monero)
2019-11-15threadpool: use std::move when taking an element off the queuemoneromooo-monero1-1/+1
It has a std::function, which can have a capture context, and the function runtime might be small
2019-11-10core_tests: reset thread pool between testsmoneromooo-monero1-7/+22
Avoids a DB error (leading to an assert) where a thread uses a read txn previously created with an environment that was since closed and reopened. While this usually works since BlockchainLMDB renews txns if it detects the environment has changed, this will not work if objects end up being allocated at the same address as the previous instance, leading to stale data usage. Thanks hyc for the LMDB debugging.
2019-03-05Update 2019 copyrightbinaryFate1-1/+1
2018-11-15Removed a lot of unnecessary includesMartijn Otto1-4/+0
2018-10-02Catch more exceptions in dtorsmoneromooo-monero1-0/+10
Misc coverity reports
2018-09-29Merge pull request #4459Riccardo Spagni1-1/+2
bcf3f6af fuzz_tests: catch unhandled exceptions (moneromooo-monero) 3ebd05d4 miner: restore stream flags after changing them (moneromooo-monero) a093092e levin_protocol_handler_async: do not propagate exception through dtor (moneromooo-monero) 1eebb82b net_helper: do not propagate exceptions through dtor (moneromooo-monero) fb6a3630 miner: do not propagate exceptions through dtor (moneromooo-monero) 2e2139ff epee: do not propagate exception through dtor (moneromooo-monero) 0749a8bd db_lmdb: do not propagate exceptions in dtor (moneromooo-monero) 1b0afeeb wallet_rpc_server: exit cleanly on unhandled exceptions (moneromooo-monero) 418a9936 unit_tests: catch unhandled exceptions (moneromooo-monero) ea7f9543 threadpool: do not propagate exceptions through the dtor (moneromooo-monero) 6e855422 gen_multisig: nice exit on unhandled exception (moneromooo-monero) 53df2deb db_lmdb: catch error in mdb_stat calls during migration (moneromooo-monero) e67016dd blockchain_blackball: catch failure to commit db transaction (moneromooo-monero) 661439f4 mlog: don't remove old logs if we failed to rename the current file (moneromooo-monero) 5fdcda50 easylogging++: test for NULL before dereference (moneromooo-monero) 7ece1550 performance_test: fix bad last argument calling add_arg (moneromooo-monero) a085da32 unit_tests: add check for page size > 0 before dividing (moneromooo-monero) d8b1ec8b unit_tests: use std::shared_ptr to shut coverity up about leaks (moneromooo-monero) 02563bf4 simplewallet: top level exception catcher to print nicer messages (moneromooo-monero) c57a65b2 blockchain_blackball: fix shift range for 32 bit archs (moneromooo-monero)
2018-06-26threadpool: allow leaf functions to run concurrentlymoneromooo-monero1-11/+26
Decrease the number of worker threads by one to account for the fact the calling thread acts as a worker thread now
2018-05-20threadpool: allow constructing an object, and misc tweaksmoneromooo-monero1-4/+4
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-02-02threadpool: catch exceptions in dtor, to avoid terminatemoneromooo-monero1-0/+18
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-01-26Readd copyright starting datexmr-eric1-1/+1
2018-01-26Update 2018 copyrightxmr-eric1-1/+1
2017-12-23threadpool: fix deadlock in recursive waiter usagemoneromooo-monero1-1/+7
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-11-02Use max_concurrency as-isHoward Chu1-2/+2
Don't try to 2nd guess user
2017-09-15Tweak concurrency limitsHoward Chu1-1/+5
Create capacity for 2x max, but lie about it
2017-09-14Use a threadpoolHoward Chu1-0/+113
Instead of constantly creating and destroying threads