constellation-rs / amadeus

Harmonious distributed data analysis in Rust.
https://constellation.rs/amadeus
Apache License 2.0
472 stars 26 forks source link

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

Closed robinbernon closed 3 years ago

robinbernon commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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.