-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include rayon? #6
Comments
It is only created when needed, then exists for the rest of the process life. This is sort of natural from Rust's philosophy to avoid "life before main", so automatic
It's a data-parallelism library, best for CPU-bound work. But it doesn't have to be trivial -- for instance parallel sorting has partition data at each step before splitting into further parallel work.
Yeah, I agree with this. Channels might be OK if the receiver is outside the pool, but generally you only want functional tree-like dependencies in rayon --
You're probably thinking of this note, "Because op is executing within the Rayon thread-pool, thread-local data from the current thread will not be accessible." Or maybe this one. There's no undefined behavior here. It's just more of a reminder that these really are crossing thread boundaries, so TLS will access different memory. |
@cuviper thanks for the clarifications! I think with these claritfications we should probably include rayon in I am particularily happy that rayon does not require resources if never used. That makes me significantly happier in including it by default. |
@killercup I think you have better opinions on this than I. I would just like to express my experiences integrating rayon directly into
ergo_sync
and see whether it is actually a dependency we want/need. @llogiq you might be interested too.First off, rayon is a fantastic library.
ergo_sync
mentions it as a crate you probably want to use for parallel processing at the top of its docs.However, I am still unclear what the cost of rayon is. A couple of questions I would like answered before we assume rayon should be included:
When I tried to use
rayon
for the examples inergo_sync
I found that I couldn't because of the above issues, which concerned me when including it as a core part of the parallel processing story. I found thatspawn
with channels accomplished pretty much everything needed, and did it very expressively with few surprises and probably very performantly as well. The way I see it, the main use of rayon is to doparking_lots
of data that can be split into chunks and processed in paralel.I would like to include rayon because it really is useful for parallel processing. Honestly
par_sort()
alone probably makes it a worthwhile library. However I would like to understand the pros/cons/usecases before we include it.The text was updated successfully, but these errors were encountered: