-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Resolve at_exit strategy after std::thread lands #20012
Comments
aturon
added
A-libs
A-runtime
Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows
labels
Dec 19, 2014
Nominating for P-High. |
aturon
added a commit
to aturon/rust
that referenced
this issue
Dec 19, 2014
The [final step](rust-lang#19654) of runtime removal changes the threading/process model so that the process shuts down when the main thread exits. But several shared resources, like the helper thread for timeouts, are shut down when the main thread exits (but before the process ends), and they are not prepared to be used after shut down, but other threads may try to access them during the shutdown sequence of the main thread. As an interim solution, the `at_exit` cleanup routine is simply skipped. Ultimately, these resources should be made to safely handle asynchronous shutdown, usually by panicking if called from a detached thread when the main thread is ending. See issue for details rust-lang#20012 This is a [breaking-change] for anyone relying on `at_exit`.
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Dec 30, 2014
The new semantics of this function are that the callbacks are run when the *main thread* exits, not when all threads have exited. This implies that other threads may still be running when the `at_exit` callbacks are invoked and users need to be prepared for this situation. Users in the standard library have been audited in accordance to these new rules as well. Closes rust-lang#20012
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Dec 31, 2014
The new semantics of this function are that the callbacks are run when the *main thread* exits, not when all threads have exited. This implies that other threads may still be running when the `at_exit` callbacks are invoked and users need to be prepared for this situation. Users in the standard library have been audited in accordance to these new rules as well. Closes rust-lang#20012
Fix was reverted, not actually closed. |
This was referenced Mar 9, 2015
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Mar 11, 2015
This reverts commit aec67c2. Closes rust-lang#20012 This is temporarily rebased on rust-lang#23245 as it would otherwise conflict, the last commit is the only one relevant to this PR though.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The final step of runtime removal changes the threading/process model so that the process shuts down when the main thread exits. But several shared resources, like the helper thread for timeouts, are shut down when the main thread exits (but before the process ends), and they are not prepared to be used after shut down, but other threads may try to access them during the shutdown sequence of the main thread.
As an interim solution, the
at_exit
cleanup routine is simply skipped.Ultimately, these resources should be made to safely handle asynchronous shutdown, usually by panicking if called from a detached thread when the main thread is ending.
The text was updated successfully, but these errors were encountered: