You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
std::thread::hardware_concurrency should only be treated as a hint
C++'s std::thread::hardware_concurrency() is allowed to return 0 if it cannot compute the value for you. From a cursory reading of the code: if this were to happen, you will have an empty thread pool. It may be better to use a value of 1 in that case, so that you can still submit work.
The text was updated successfully, but these errors were encountered:
bstamour
changed the title
[REQ]Handle cases where std::thread::hardware_concurrency() returns 0
[REQ]Handle cases where hardware_concurrency() returns 0
Jun 14, 2022
std::thread::hardware_concurrency
should only be treated as a hintC++'s
std::thread::hardware_concurrency()
is allowed to return 0 if it cannot compute the value for you. From a cursory reading of the code: if this were to happen, you will have an empty thread pool. It may be better to use a value of 1 in that case, so that you can still submit work.The text was updated successfully, but these errors were encountered: