-
Notifications
You must be signed in to change notification settings - Fork 22
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
Port from threadpool to rayon #199
Comments
the initial implementation was using rayon, but it had a few limitations, so we had to roll our own. we tried to use the nice iterator based api. it's been a while, but i think these were the problems:
of course, you can simply add rayon and not use the iterator based api. but the decision was made to not use rayon because of it's size. we only needed a thread pool, and not all of that other functionality. on the other hand, it's not good to have an unmaintained dependency. does rayon have a mechanism to detect whether multi threading is available? that would be a feature we need, that thread pool doesn't seem to have. it seems the |
You can use the
The best strategy is probably to have a |
Oh, good to know :) Thanks for offering your help! We're actually in the middle of discussing that in another issue, see #200 i think the developer experience is better when the crate will not crash when used out of the box. for that reason, i think it would be great to not fail at runtime, but instead automatically fallback to the single-threaded code, which is already there. as there is an automatic solution, why should we ask the users of the library to manually switch that crate feature :) if there is another reason to add a threading feature gate, we can do it anyways, i'm just saying the crate could fallback automatically instead of crashing |
What can be improved or is missing?
The
threadpool
crate is no longer maintained. Meanwhile,rayon
is not only much better maintained, but also supports using custom functions for spawning threads.Implementation Approach
We could replace the usage of
threadpool
withrayon::spawn
et al. Sincethreadpool
is in the public API, this is a breaking change.The text was updated successfully, but these errors were encountered: