Unsurprisingly, there’s others that have already been wondering the same.
Yes, that should definitely be possible. By the way, I am not sure what kind of nesting for multiple join
calls is the best / most efficient. Might make sense to get familiar with the actual implementation if the thing to judge that best; and possibly compare to the design decisions for parallel iterators, I guess…
A join
would, as far as I can tell, also add a layer of dynanicness (in its interaction with the thread pool, work queue and such), so adding another layer and producing &mut dyn FnMut()
callbacks could be feasible. I’d be curious whether such an (yet to be implemented, I’m trying it at the moment…) approach, using parallel iterators, would perform better or worse than the “use lots of rayon::join
” approach.