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 upBump futures to 0.1.16, move to `Notify` API #357
Conversation
This comment has been minimized.
This comment has been minimized.
|
On AppVeyor seems like a Rust MinGW build issue(nightly regression?): https://ci.appveyor.com/project/lilianmoraru/rayon/build/1.0.4 In that build, this is being tested: master...lilianmoraru:master Pinging @nikomatsakis to raise awareness of a probable nightly regression. |
This comment has been minimized.
This comment has been minimized.
|
Hmm, similar gcc issues were reported in the users forum: |
This comment has been minimized.
This comment has been minimized.
|
The issue is fixed on the latest nightly(not sure about beta but it is not relevant to this pull request since it already passed that test): https://ci.appveyor.com/project/lilianmoraru/rayon/build/1.0.5 |
This comment has been minimized.
This comment has been minimized.
|
I'd rather make these changes atop of #344 |
This comment has been minimized.
This comment has been minimized.
|
I'll have to review this |
This comment has been minimized.
This comment has been minimized.
|
Sure I can rebase this on #344 once it lands. |
This comment has been minimized.
This comment has been minimized.
|
We now have separated rayon-futures -- please do rebase on that! |
This comment has been minimized.
This comment has been minimized.
|
@cuviper Thanks for the heads up, rebased! |
cuviper
requested a review
from
nikomatsakis
Sep 17, 2017
cuviper
reviewed
Sep 17, 2017
| @@ -23,6 +23,6 @@ default-features = false | |||
| [dev-dependencies] | |||
| compiletest_rs = "0.2.1" | |||
| docopt = "0.7" | |||
| futures = "0.1.7" | |||
| futures = "0.1.14" | |||
This comment has been minimized.
This comment has been minimized.
cuviper
Sep 17, 2017
Member
I missed this dependency in the shuffle, but I think it can just go away, as rayon-futures now tests itself.
This comment has been minimized.
This comment has been minimized.
|
OK so this looks pretty reasonable! I'll be honest, I'm having a bit of a hard time wrapping my head around it, in part because I'm just a bit tired right now. =) @leodasvacas did you want to update the README.md etc? |
nikomatsakis
approved these changes
Sep 22, 2017
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis Nice, I was just looking for an OK before updating the README, will do. |
leodasvacas
changed the title
Bump futures to 0.1.14, move to `Notify` API
Bump futures to 0.1.16, move to `Notify` API
Sep 22, 2017
leodasvacas
added some commits
Sep 17, 2017
This comment has been minimized.
This comment has been minimized.
|
The possessive "its" (without an apostrophe) was correct before. |
This comment has been minimized.
This comment has been minimized.
|
@cuviper Fixed it thanks! |
cuviper
referenced this pull request
Sep 25, 2017
Closed
Transition from deprecated Unpark to Notify #447
tmccombs
approved these changes
Sep 25, 2017
| @@ -227,21 +226,21 @@ This is good, because there *are* still active refs to the | |||
| `ScopeFuture` after we enter the *COMPLETE* state. There are two | |||
| sources of these: unpark values and the future result. | |||
|
|
|||
| **Unpark values.** We may have given away `Arc<Unpark>` values -- | |||
| **NotifyHandle values.** We may have given away `NotifyHandle` values -- | |||
| these are trait objects, but they are actually refs to our | |||
This comment has been minimized.
This comment has been minimized.
tmccombs
Sep 25, 2017
Contributor
technically NotifyHandle is a struct, not a trait object, although it does contain a raw pointer to a trait object, so the old text sort of still applies.
| F: Future + Send + 'scope, | ||
| S: ScopeHandle<'scope>; | ||
|
|
||
| impl<'scope, F, S> Clone for ArcScopeFuture<'scope, F, S> |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
leodasvacas
Sep 26, 2017
Author
Contributor
Nope, derive isn't smart enough I think it derives only when F: Clone and S: Clone. See rust-lang/rust#26925.
| self.0.notify(id) | ||
| } | ||
|
|
||
| fn clone_id(&self, id: usize) -> usize { |
This comment has been minimized.
This comment has been minimized.
tmccombs
Sep 25, 2017
Contributor
I don't think you really need to implement clone_id and drop_id, since you don't ever use a meaningful id that needs to be cloned or dropped specially.
| } | ||
| } | ||
|
|
||
| fn clone_id(&self, id: usize) -> usize { |
This comment has been minimized.
This comment has been minimized.
tmccombs
Sep 25, 2017
Contributor
Again I don't think you need to implement clone_id and drop_id here.
This comment has been minimized.
This comment has been minimized.
|
@tmccombs Thank you very much for the review! I've clarified the README. Regarding the |
This comment has been minimized.
This comment has been minimized.
|
bors r+ I've got to dig more into the notify APIs and stuff myself, but this looks really good. We can continue iterating here regardless. Thanks @leodasvacas very much and sorry about the delays. |
bors bot
added a commit
that referenced
this pull request
Oct 17, 2017
This comment has been minimized.
This comment has been minimized.
|
PS thanks to @tmccombs for the review as well. =) It's good to have more eyes on this. |
This comment has been minimized.
This comment has been minimized.
Timed out |
This comment has been minimized.
This comment has been minimized.
|
bors retry |
This comment has been minimized.
This comment has been minimized.
|
bors r=nikomatsakis |
bors bot
added a commit
that referenced
this pull request
Oct 18, 2017
This comment has been minimized.
This comment has been minimized.
Build failed |
This comment has been minimized.
This comment has been minimized.
|
Looks like a corrupted rustc install on OSX stable. Third time's the charm, or I'll merge it manually: @bors r=nikomatsakis |
This comment has been minimized.
This comment has been minimized.
notriddle
commented
Oct 18, 2017
|
Drop the |
This comment has been minimized.
This comment has been minimized.
|
Bah, thanks. bors r=nikomatsakis |
bors bot
added a commit
that referenced
this pull request
Oct 18, 2017
This comment has been minimized.
This comment has been minimized.
Timed out |
leodasvacas commentedJun 5, 2017
Fixes #356. See that issue for previous discussion. Ping @cuviper.
The
NotifyAPI is not fond ofArc<Notify>as the old API was withArc<Unpark>. Instead it prefers to take a genericT: Into<UnsafeNotify>. Because of the'staticrestriction in the implementation provided by futures-rs we need to roll our own implementation ofUnsafeNotifyand jump through extra hoops to hide the lifetimes inScopeFuture.The implementation is easier to follow if you consider that it is analogous to the implementation for
Arcin futures-rs.As a bright side, the old
make_unparkis gone along with theunparkfield, we now simply reuse thethisself reference.There are probably many places where the unpark terminology should be switched to notify, I should also update the great README.md.