Hello, I want to parallelize an iteration but i don't know what is the best way to do this. Using locks the performance is terrible.
fn func(mut data: &mut Datatype) {
(0..N)
.into_par_iter()
.for_each(|j| {
other_func(&mut data);
});
(0..N)
.into_par_iter()
.for_each(|j| {
other_func(&mut data);
});
}
This is an example code, but i need to avoid doing data.par_iter_mut() because i don't need to parallelize everything in data.
Would you recommend something ? Thanks a lot.