Skip to content

feat(sys): add sys_available_parallelism - #1184

Merged
stlankes merged 1 commit into
mainfrom
sys_available_parallelism
May 14, 2024
Merged

feat(sys): add sys_available_parallelism#1184
stlankes merged 1 commit into
mainfrom
sys_available_parallelism

Conversation

@mkroening

Copy link
Copy Markdown
Member

We could deprecate sys_get_processor_count in favor of sys_available_parallelism.

Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
@stlankes

Copy link
Copy Markdown
Contributor

Why is this name more useful? I like the naming from num_cpus.

@mkroening

Copy link
Copy Markdown
Member Author

I don't feel strong on this, but the reasoning behind Rust naming it like this (rust-lang/rust#74479 (comment), rust-lang/rust#89324) makes sense to me:

For the user, it is important to know how many threads they can spawn to make use of the available concurrency of the system. It is not relevant to how many physical CPU cores or hyperthreads or hardware threads this maps.

@stlankes

Copy link
Copy Markdown
Contributor

Ok. At this stage we should not remove the old interface. Just to support num_cpus.

@stlankes
stlankes added this pull request to the merge queue May 14, 2024
Merged via the queue into main with commit 56b1ac7 May 14, 2024
@mkroening
mkroening deleted the sys_available_parallelism branch May 14, 2024 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants