Always use Configuration#Concurrency, not std::thread::hardware_concurrency() - #9643
Conversation
|
On its own from #7845. You said this is an improvement by itself. |
f2754a4 to
0e415b0
Compare
std::thread::hardware_concurrency()
|
Making Or worse, a Anyways, if this PR is correct, it would also be correct to delay the initialization of the thread pool until after |
|
What about the following?
|
|
With that suggestion, would you have an explicit |
|
|
Re: #9643 (comment) Just saw that the I/O engine already has the same "problem". So this is fine. |
You mean it starts the threads automatically on demand? |
|
Exactly, that's why it's lazy-inited. |
julianbrost
left a comment
There was a problem hiding this comment.
Wait, I just noticed that you haven't changed anything at all here.
Just saw that the I/O engine already has the same "problem".
If component A has an undesired property and component B doesn't, obviously the way forward is to also introduce that undesired property in component B. Well, actually, it isn't.
Not exactly. ThreadPool#Post() is called by Utility::QueueAsyncCallback() which is called by Timer::TimerThreadProc() due to including but not limited to WorkQueue#WorkQueue() used by ConfigItem::RunWithActivationContext() which is called pre-commit. Therefore I'll do #9643 (comment) . |
not to start many threads before the user could override their amount (-D).
0e415b0 to
6e2b687
Compare
|
|
Also Activity Monitor confirms different thread amounts for -DConfiguration.Concurrency=1, nothing and -DConfiguration.Concurrency=42. |
6e2b687 to
6824ad8
Compare
julianbrost
left a comment
There was a problem hiding this comment.
Tested it and should be fine apart from that small spelling detail below that doesn't have an effect on the functionality.
The user (-D) or we could have changed Configuration.Concurrency, so correct the thread pool's thread amount.
6824ad8 to
3fae41e
Compare
refs #7842
fixes #9147