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

Allow more than 1 worker per thread pool set by set-thread-affinity #873

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

damster101
Copy link
Contributor

No description provided.

@@ -109,18 +109,10 @@ impl<'a> Broker<'a> {

cfg_if! {
if #[cfg(any(target_os = "linux", target_os = "windows"))] {
let available_threads = available_parallelism().expect("Unrecoverable: Failed to get thread count").get();
Copy link
Contributor

@FreezyLemon FreezyLemon Sep 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move this to the second #[cfg]-gated block. If it's here, this will always panic on any linux/windows platform that does not support available_parallelism or for any OS user without the necessary permissions on Linux.

If you move it down, it won't call available_parallelism unless the user sets a non-zero thread affinity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I fully agree.
I changed the commit.
And also trimmed the code in the process, as well as making other minor improvements...

Copy link
Collaborator

@shssoichiro shssoichiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@shssoichiro shssoichiro merged commit 46cd62c into master-of-zen:master Sep 25, 2024
5 checks passed
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.

3 participants