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

Adding input param of num_cores to ThreadPool::new() #129

Conversation

robinbernon
Copy link
Contributor

In keeping to a similar input style to the rust-threadpool crate: https://github.com/rust-threadpool/rust-threadpool/blob/master/src/lib.rs#L367 thought it would be best to have the new input param as num_cores.

@alecmocatta
Copy link
Member

Thanks @robinbernon, looks good! Two things: would you be able to make the same change to ProcessPool::new, and given its ordering (fn new(processes: Option<usize>, tasks_per_core: Option<usize>, resources: Resources)), perhaps num_cores could come before tasks_per_core for both methods, and also be renamed just cores?

@robinbernon
Copy link
Contributor Author

robinbernon commented Mar 9, 2021

Thanks @robinbernon, looks good! Two things: would you be able to make the same change to ProcessPool::new, and given its ordering (fn new(processes: Option<usize>, tasks_per_core: Option<usize>, resources: Resources)), perhaps num_cores could come before tasks_per_core for both methods, and also be renamed just cores?

Have added cores input for ProcessPool and also changed the input param from num_cores => cores.

@alecmocatta alecmocatta force-pushed the threadpool_to_take_num_cores_input branch from a10128a to cbdaec0 Compare March 13, 2021 11:46
@alecmocatta alecmocatta merged commit 7f071aa into constellation-rs:master Mar 13, 2021
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