-
Notifications
You must be signed in to change notification settings - Fork 354
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
allow explicit control over single-threaded vs multi-threaded #25
Comments
Copying a question that just tweeted. Not sure what to do about the standalone functions:
|
Rather than create duplicated versions of all the top level functions to work around this, I'm going to add a single |
This is a new interface that allows the caller to provide a multi-threading implementation. It's defined in terms of a new `Join` trait, for which we provide two implementations, `SerialJoin` and `RayonJoin`. This lets the caller control when multi-threading is used, rather than the previous all-or-nothing design of the "rayon" feature. Although existing callers should keep working, this is a compatibility break, because callers who were relying on automatic multi-threading before will now be single-threaded. Thus the next release of this crate will need to be version 0.2. See #25 and #54.
I just pushed fc219f4, implementing the |
I just filed an issue with rust-lang/rust over the test failures above. rust-lang/rust#68905 |
|
Right now there is only the top-level
rayon
feature, so multi-threading is all-or-nothing. It would be better to allow each caller to choose, and perhaps to provide other executors besides Rayon. We could keep the default governed by therayon
feature, or we could make the default always single-threaded, not sure yet.This might allow us to support a flag in
b3sum
that controls multithreading at runtime, for example.@pcwalton mentioned one approach here: https://twitter.com/pcwalton/status/1215349922267987970
The text was updated successfully, but these errors were encountered: