-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Eliminate unsafety from scheduler operations #6210
Comments
r? Mostly refactoring, and adding some of the remaining types described in #4419. The [`Local`](https://github.com/brson/rust/blob/3b4ff41511cfaa5e311b03d16b47bf40c117fa2f/src/libcore/rt/local.rs#L17) trait collects some common, often unsafe patterns around task-local and thread-local values. Making all these types safe is largely the aim of #6210.
Triage bump |
Status bump. The recent scheduler restructuring did a fair bit to eliminate unsafe blocks. In the sched.rs file we are down to unsafe code for the raw context swap, the cleanup job execution, and the "run" operation on the event loop. I think the first two are fundamental and unavoidable, the unsafe fun might be escapable. The unsafe to worry about is now all in the io code. |
Triage bump -- @brson, is there anything blocking this? |
no longer relevant for the standard libraries due to #17325 |
The new runtime, scheduler, and I/O types are often accessed through unsafe mutable pointers. There are many interrelated runtime features that expect independent access to mutable task-local or thread-local state, and this is difficult to model safely.
Many of the unsafe features that need to be fixed use functions called
unsafe_borrow*
, likeunsafe_borrow
,unsafe_borrow_io
,unsafe_borrow_local_services
.More things will need to be passed by value or ~. There are probably useful functional idioms that I'm not familiar with that could help.
The text was updated successfully, but these errors were encountered: