mirror of
https://github.com/monero-project/monero.git
synced 2024-12-25 04:59:43 +00:00
Use max_concurrency as-is
Don't try to 2nd guess user
This commit is contained in:
parent
8d511f3c24
commit
6738753b30
1 changed files with 2 additions and 2 deletions
|
@ -39,7 +39,7 @@ namespace tools
|
||||||
threadpool::threadpool() : running(true), active(0) {
|
threadpool::threadpool() : running(true), active(0) {
|
||||||
boost::thread::attributes attrs;
|
boost::thread::attributes attrs;
|
||||||
attrs.set_stack_size(THREAD_STACK_SIZE);
|
attrs.set_stack_size(THREAD_STACK_SIZE);
|
||||||
max = tools::get_max_concurrency() * 2;
|
max = tools::get_max_concurrency();
|
||||||
size_t i = max;
|
size_t i = max;
|
||||||
while(i--) {
|
while(i--) {
|
||||||
threads.push_back(boost::thread(attrs, boost::bind(&threadpool::run, this)));
|
threads.push_back(boost::thread(attrs, boost::bind(&threadpool::run, this)));
|
||||||
|
@ -74,7 +74,7 @@ void threadpool::submit(waiter *obj, std::function<void()> f) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int threadpool::get_max_concurrency() {
|
int threadpool::get_max_concurrency() {
|
||||||
return max / 2;
|
return max;
|
||||||
}
|
}
|
||||||
|
|
||||||
void threadpool::waiter::wait() {
|
void threadpool::waiter::wait() {
|
||||||
|
|
Loading…
Reference in a new issue