Regroup all manual threading algorithms into a single module

This commit is contained in:
Rodolphe Bréard 2024-10-31 00:07:58 +01:00
parent 2038cb93ee
commit 1c3a72da46
3 changed files with 8 additions and 11 deletions

View file

@ -1,7 +1,5 @@
mod lpt;
mod manual_threading;
mod rayon;
mod single_thread;
pub use lpt::*;
pub use manual_threading::*;
pub use rayon::*;
pub use single_thread::single_thread;

View file

@ -13,6 +13,12 @@ pub fn multi_threads(data: &[Task]) {
run_multi(data);
}
pub fn single_thread(data: &[Task]) {
for task in data {
task.execute();
}
}
#[inline(always)]
fn run_multi(data: Vec<Task>) {
let data_mt = Arc::new(Mutex::new(data));

View file

@ -1,7 +0,0 @@
use crate::Task;
pub fn single_thread(data: &[Task]) {
for task in data {
task.execute();
}
}