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
Stabilize spawning an asynchronous task and convenience methods on ThreadPool #371
Conversation
45e33b4
to
1c8a427
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have questions about #368 which you stacked this on, but I'm happy with the selected stabilizations.
ThreadPool::global -- I don't know that we want to expose the Arc here, although it's no real commitment
It's being &'static Arc
that's weird to me. I don't think we have any APIs needing Arc<ThreadPool>
, and 'static
already proves it won't go away. (I've forgotten the reason why this is even Arc
at all...)
- `rayon_core::ThreadPool::join` - `rayon_core::ThreadPool::scope` - `rayon_core::ThreadPool::spawn` - `rayon_core::spawn` -- runs async task in current (or global) thread-pool The only one that enables something fundamentally new that wasn't available in a stable API is `rayon_core::spawn`. The `ThreadPool` APIs are convenience wrappers around other APIs. The following APIs remain **unstable**: - `ThreadPool::global` -- I don't know that we want to expose th `Arc` here, although it's no real commitment - everything related to futures -- that is all planned to change
1c8a427
to
e1b4d8a
Compare
I'm not sure the reason is super good. I think it was because I found that some code I was using wanted to have an But maybe just returning |
I haven't tested yet, but wouldn't a crate be able to automatically add this cfg in using a build.rs, without consumers knowing? |
@seanmonstar I believe that can only enable a cfg for that crate itself, not its build of rayon. |
@seanmonstar I don't know, maybe. If so, I mean, what ya' gonna do... |
Building on #368, this branch stabilizes the
spawn
API and a bunch of convenience methods inThreadPool
:rayon_core::ThreadPool::join
rayon_core::ThreadPool::scope
rayon_core::ThreadPool::spawn
rayon_core::spawn
-- runs async task in current (or global) thread-poolThe only one that enables something fundamentally new that wasn't available in a stable API is
rayon_core::spawn
. TheThreadPool
APIs are convenience wrappers around other APIs.The following APIs remain unstable:
ThreadPool::global
-- I don't know that we want to expose thArc
here, although it's no real commitment