Skip to content
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

Consider renaming task park / unpark #312

Closed
carllerche opened this issue Dec 28, 2016 · 5 comments
Closed

Consider renaming task park / unpark #312

carllerche opened this issue Dec 28, 2016 · 5 comments

Comments

@carllerche
Copy link
Member

carllerche commented Dec 28, 2016

Placeholder issue for an 0.2 discussion.

Originally, the names were picked for symmetry with thread park / unpark. However, the behavior is sufficiently difficult that I believe the naming is leading to unnecessary confusion (this is also based off of observing questions in Gitter).

@alexcrichton alexcrichton added this to the 0.2 release milestone Feb 8, 2017
@leoyvens
Copy link
Contributor

leoyvens commented Mar 27, 2017

To unpark a thread means immediately wake it, to unpark a task usually means to schedule it to be polled. I'd suggest park -> suspend/delay/pause and unpark -> schedule. Since future is a time metaphor it seems helpful to use other time metaphors.

@carllerche
Copy link
Member Author

To unpark a thread means immediately wake it

That's not strictly true. unparking a thread has no guarantees in terms of when the thread gets scheduled to execute. Just like w/ futures, the OS scheduler is free to schedule the thread as appropriate.

@carllerche
Copy link
Member Author

I propose either:

  • task::current() & Task::notify()
  • Leave it as is.

Now is the time to make the change (#436). It should either happen or we leave the naming as is.

@ipetkov
Copy link
Contributor

ipetkov commented Apr 5, 2017

+1 on current/notify. It always bothered me that park implied side effects when it had none

@carllerche carllerche mentioned this issue Apr 5, 2017
13 tasks
@alexcrichton
Copy link
Member

Done! (#436)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants