Open bestouff opened 3 years ago
This would be nifty, but a fairly niche optimization. Assuming you already have a populated Synclist
named sl
, you can do this in user code like:
use rayon::iter::ParallelBridge;
use rayon::prelude::ParallelIterator;
...
let parallel_iterator = (0..).map_while(|i| sl.get(i)).par_bridge();
...
This might not be as performant as a bespoke implementation of the traits from rayon
, but it will observe concurrent pushes to the Synclist
and it doesn't require unsafe
.
Would it be possible to implement
par_iter
rom rayon ?Sorry no PR for this one ...