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

Dev/sol/tokio #433

Merged
merged 7 commits into from
Nov 13, 2023
Merged

Dev/sol/tokio #433

merged 7 commits into from
Nov 13, 2023

Conversation

SoloJacobs
Copy link
Contributor

WIP

@SoloJacobs SoloJacobs force-pushed the dev/sol/tokio branch 2 times, most recently from 8c66516 to 46fc130 Compare November 9, 2023 10:11
@SoloJacobs SoloJacobs requested a review from jherbel November 9, 2023 10:16
Copy link
Contributor

@jherbel jherbel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thanks!

@jherbel jherbel self-requested a review November 10, 2023 16:31
Copy link
Contributor

@jherbel jherbel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After trying this out and then debugging for a long time, I found out that we cannot use std::hint::spin_loop in combination with tokio. I cannot say what the underlying problem is. Using the two in combination leads to random deadlocks. Replacing std::hint::spin_loop with tokio::task::yield_now().await works.

@SoloJacobs
Copy link
Contributor Author

After trying this out and then debugging for a long time, I found out that we cannot use std::hint::spin_loop in combination with tokio. I cannot say what the underlying problem is. Using the two in combination leads to random deadlocks. Replacing std::hint::spin_loop with tokio::task::yield_now().await works.

The explanation is probably this: As soon as the scheduler enters the loop, there is no way for it to exit it. Since the scheduler here is the tokio scheduler, it will only pause a task, if the task itself reports, that it can be paused. Pausing here here just means awaiting a future. In your implementation this works correctly, since now the scheduler gets the chance to resume other tasks.

I am not sure what you changed, maybe we should have a look together at this change, and what other ideas I have here.

Adds two new dependencies:
* tokio
* tokio_utils

We want to remove async-std, since it is no longer maintained.
We want to remove async-std, since it is no longer maintained.
We want to remove async-std, since it is no longer maintained.
We want to remove async-std, since it is no longer maintained.
We want to remove async-std, since it is no longer maintained.
We want to remove async-std, since it is no longer maintained.
`futures` is no longer needed, because of the addition of tokio.

We want to remove async-std, since it is no longer maintained.
@SoloJacobs SoloJacobs merged commit b122f1b into main Nov 13, 2023
13 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 13, 2023
@SoloJacobs SoloJacobs deleted the dev/sol/tokio branch November 13, 2023 12:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants