Running two operations together

The parallel iterators from the last recipe are internally built upon a more fundamental function, rayon::join, which takes two closures and potentially runs them in parallel. This way, even the balance of performance gain versus the overhead of spawning a thread has been done for you.

If you have an algorithm that doesn't use iterators but still consists of some clearly separated parts that could benefit from running concurrently, consider using rayon::join for that.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.87.161