Regroup all manual threading algorithms into a single module
This commit is contained in:
parent
2038cb93ee
commit
1c3a72da46
3 changed files with 8 additions and 11 deletions
|
@ -1,7 +1,5 @@
|
||||||
mod lpt;
|
mod manual_threading;
|
||||||
mod rayon;
|
mod rayon;
|
||||||
mod single_thread;
|
|
||||||
|
|
||||||
pub use lpt::*;
|
pub use manual_threading::*;
|
||||||
pub use rayon::*;
|
pub use rayon::*;
|
||||||
pub use single_thread::single_thread;
|
|
||||||
|
|
|
@ -13,6 +13,12 @@ pub fn multi_threads(data: &[Task]) {
|
||||||
run_multi(data);
|
run_multi(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn single_thread(data: &[Task]) {
|
||||||
|
for task in data {
|
||||||
|
task.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn run_multi(data: Vec<Task>) {
|
fn run_multi(data: Vec<Task>) {
|
||||||
let data_mt = Arc::new(Mutex::new(data));
|
let data_mt = Arc::new(Mutex::new(data));
|
|
@ -1,7 +0,0 @@
|
||||||
use crate::Task;
|
|
||||||
|
|
||||||
pub fn single_thread(data: &[Task]) {
|
|
||||||
for task in data {
|
|
||||||
task.execute();
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue