-
Notifications
You must be signed in to change notification settings - Fork 352
Open
Labels
Description
I’m currently updating my code to the new ArrayRef type and I have some problem with access to &ArrayRef from multiple threads (see example below).
use ndarray::Zip;
use ndarray::prelude::*;
fn test_ref(a: &ArrayRef1<f64>) { // does not compile
let b = array![0.];
Zip::from(&b).par_for_each(|_| {
let _ = a[0];
});
}
fn test_view(a: &ArrayView1<f64>) { // works
let b = array![0.];
Zip::from(&b).par_for_each(|_| {
let _ = a[0];
});
}
fn main() {
let a = array![1.];
test_view(&a.view());
test_ref(&a);
}
Attached is the error I get.
Is this expected ? Should I stick to ArrayView for those function ?
akern40