Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upintroduce internal API and rebase future support to use it #344
Conversation
nikomatsakis
force-pushed the
factor-out-futures
branch
from
3d5276f
to
3c2e422
May 23, 2017
nikomatsakis
force-pushed the
factor-out-futures
branch
from
3c2e422
to
502d2bd
May 23, 2017
nikomatsakis
referenced this pull request
Jun 10, 2017
Merged
Bump futures to 0.1.16, move to `Notify` API #357
This comment has been minimized.
This comment has been minimized.
|
It would be great if rayon could move towards stabilizing the future API. Do you intend to merge this PR in the near future? Is there a good workaround I could use for futures until then? |
cuviper
referenced this pull request
Sep 9, 2017
Merged
Extract rayon-futures as a separate crate #436
This comment has been minimized.
This comment has been minimized.
|
I rebased this in #436. |
cuviper
closed this
Sep 16, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
nikomatsakis commentedMay 23, 2017
This PR introduces an (unstable) internal API into rayon-core that gives a lower-level, and unsafe, interface to the Rayon scheduler. In particular, you can do two things:
scopeor aThreadPool.This API allows us to factor out the future support (also unstable, as it is built on an unstable API) into the rayon package. This means that we can move from futures 0.2 to futures 0.3 without a major release of rayon-core.
The main concern here is whether this unstable API is suitably generic or can be improved. Probably time will tell! Some concerns:
Arc. Given that the API is unsafe, one might wish that it was suitably generic that you could implement bothjoinandScope::spawnon top of it without loss of efficiency. The latter is probably possible, but notjoin-- this is becausejoinstack-allocates its tasks, and this API currently requires anArc<Task>to spawn a task.*mutor something, but that's pushing even more unsafety.internal::task::ScopeHandle, for example, andinternal::worker::WorkerThread, rather than something flat. Not sure why I did that.I suspect the unsafe bit is inevitable, but I also suspect we can do somewhat better than this API. Still seems worth landing this as a start.