Skip to content
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

[REQ]Handle cases where hardware_concurrency() returns 0 #52

Closed
bstamour opened this issue Jun 14, 2022 · 1 comment
Closed

[REQ]Handle cases where hardware_concurrency() returns 0 #52

bstamour opened this issue Jun 14, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@bstamour
Copy link

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.

@bstamour bstamour added the enhancement New feature or request label Jun 14, 2022
@bstamour 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
@bshoshany
Copy link
Owner

Thanks, this will be fixed in the next release (see #51).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants