Skip to content

chore: set the number of threads to the number of cores by default#148

Open
matthias-wright wants to merge 9 commits intomainfrom
m/worker-threads
Open

chore: set the number of threads to the number of cores by default#148
matthias-wright wants to merge 9 commits intomainfrom
m/worker-threads

Conversation

@matthias-wright
Copy link
Collaborator

This makes the --worker_threads CLI argument default to None. If no argument is passed, then the tokio runtime will use as many threads as there are cores. The number of cores is obtained via std::thread::available_parallelism().

According to the docs, available_parallelism can return an error, for example if the amount of parallelism is not known to the target platform, or the program lacks permission to query the amount of parallelism.
This should never happen, but in this case the number of threads will default to 4.

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.

1 participant