mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
Do not create extra thread in PipelineExecutor if num_threads is 1.
This commit is contained in:
parent
3f35d143b3
commit
faf118fb15
@ -720,6 +720,9 @@ void PipelineExecutor::executeImpl(size_t num_threads)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (num_threads > 1)
|
||||||
|
{
|
||||||
|
|
||||||
for (size_t i = 0; i < num_threads; ++i)
|
for (size_t i = 0; i < num_threads; ++i)
|
||||||
{
|
{
|
||||||
threads.emplace_back([this, thread_group, thread_num = i, num_threads]
|
threads.emplace_back([this, thread_group, thread_num = i, num_threads]
|
||||||
@ -743,6 +746,9 @@ void PipelineExecutor::executeImpl(size_t num_threads)
|
|||||||
for (auto & thread : threads)
|
for (auto & thread : threads)
|
||||||
if (thread.joinable())
|
if (thread.joinable())
|
||||||
thread.join();
|
thread.join();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
executeSingleThread(0, num_threads);
|
||||||
|
|
||||||
finished_flag = true;
|
finished_flag = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user