-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Scheduler cleanup #5909
Closed
Closed
Scheduler cleanup #5909
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We need a number of mutable references to contexts so name it `get_contexts` and return a tuple of all of them.
Each context switch has up to one cleanup job and it is always executed immediately after the context switch.
Remove the ThreadLocalScheduler type in favor of functions. Move everything into the sched::local module.
These would not be threadsafe
…nter Instead of taking a closure. It's unsafe either way. Rename it to unsafe_local_borrow.
…uler In order to do a context switch you have to give up ownership of the scheduler, effectively passing it to the next execution context. This could help avoid some situations here tasks retain unsafe pointers to schedulers between context switches, across which they may have changed threads. There are still a number of uses of unsafe scheduler pointers.
Only when borrowing the I/O implementation do we need unsafety
Conflicts: src/libcore/rt/sched/mod.rs
Merged
bors
added a commit
that referenced
this pull request
Apr 18, 2013
This is just a bunch of minor changes and simplifications to the structure of core::rt. It makes ownership of the ~Scheduler more strict (though it is still mutably aliased sometimes), turns the scheduler cleanup_jobs vector into just a single job, shunts the thread-local scheduler code off to its own file.
bors
added a commit
that referenced
this pull request
Apr 18, 2013
This builds on #5909. I've been combing through the pipes code to understand it and started refactoring a bit. * Removes pipes::spawn_* functions. These are not particularly useful since they deal with low-level pipes types. * Inlines the protocol-compiled definitions of `oneshot` and `streamp`. These are the only two uses of the protocol compiler in core and I'm inlining them so I can understand what they are doing as I work on pipes. I may un-inline them in the future. * Removes redundant functions from core::comm * Change the constructors to use the `new` convention
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Sep 10, 2020
Add a lint for an async block/closure that yields a type that is itself awaitable. This catches bugs of the form tokio::spawn(async move { let f = some_async_thing(); f // Oh no I forgot to await f so that work will never complete. }); See the two XXXkhuey comments and the unfixed `_l` structure for things that need more thought. *Please keep the line below* changelog: none
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.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is just a bunch of minor changes and simplifications to the structure of core::rt. It makes ownership of the ~Scheduler more strict (though it is still mutably aliased sometimes), turns the scheduler cleanup_jobs vector into just a single job, shunts the thread-local scheduler code off to its own file.