-
Notifications
You must be signed in to change notification settings - Fork 581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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