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

io: Refactor out usage of Weak in the io handle #4509

Closed
LucioFranco opened this issue Feb 16, 2022 · 1 comment · Fixed by #4656
Closed

io: Refactor out usage of Weak in the io handle #4509

LucioFranco opened this issue Feb 16, 2022 · 1 comment · Fixed by #4656
Assignees
Labels
A-tokio Area: The main tokio crate C-maintenance Category: PRs that clean code up or issues documenting cleanup. M-io Module: tokio/io

Comments

@LucioFranco
Copy link
Member

Remove the use of Weak in the I/O Driver handle similar to how the timer does it. This will allow the IoHandle to store Arc<Inner> rather than require Weak::upgrade to access the inner timer.

The reason for Weak was to avoid cycles caused by wakers stored in the driver pointing to the runtime which points back to the driver. The cycle can be broken by making sure nobody can register a new io resources on (shutdown?) and by emptying the driver.

@LucioFranco LucioFranco added C-maintenance Category: PRs that clean code up or issues documenting cleanup. A-tokio Area: The main tokio crate M-io Module: tokio/io labels Feb 16, 2022
@LucioFranco LucioFranco self-assigned this Feb 16, 2022
@hidva
Copy link
Contributor

hidva commented May 5, 2022

Hi, everyone, I have communicated with Lucio and I will try to solve this problem this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-maintenance Category: PRs that clean code up or issues documenting cleanup. M-io Module: tokio/io
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants