Closed arya-pathak closed 4 months ago
GDAL doesn't support that: https://gdal.org/user/multithreading.html, see also #425.
GDAL isn't thread-safe, but it is re-entrant. So, this ranyon code should be allowed:
let test: Vec<Geometry> = (0..10)
.into_par_iter()
.map(|_| Geometry::from_wkt("POINT (10, 10)").unwrap())
.collect();
right?
On trying to share the dataset object between multiple
rayon
threads for read/write operations, I get the following error:`*mut c_void` cannot be shared between threads safely within `{closure@src/lib.rs:218:19: 218:34}`, the trait `Sync` is not implemented for `*mut c_void` required because it appears within the type `&Dataset`
Using an
Arc
pointer along with a mutex introduces a lot of overhead and sometimes even slows down compared to the serial implementation. Is there any support for sharing a dataset between multiple threads safely?cc: @rkshthrmsh