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

yield_task_queue_now does not seem to make sense #674

Open
ellutionist opened this issue Sep 2, 2024 · 0 comments
Open

yield_task_queue_now does not seem to make sense #674

ellutionist opened this issue Sep 2, 2024 · 0 comments

Comments

@ellutionist
Copy link

Hi, I have used glommio for a while and I tried this api ExecutorProxy::.yield_task_queue_now, but it does not seem to work as expected.

Natually, when I see the name of this function, I think it yields the current TaskQueue and this queue will not be executed anymore in the current iteration of scheduler. (Specifically, an iteration of the loop in LocalExecutor::run https://github.com/DataDog/glommio/blob/master/glommio/src/executor/mod.rs#L1494). The scheduler is supposed to run other coroutine and poll IO, etc. However, when I actually used this function, I find my coroutine just keep running and running. Neither other task queues nor IO polling get any chance to run. I think this is a little bit wierd, since the function is called "yield_task_queue".

When I dive into the source code of the schedular, I find that in this function (https://github.com/DataDog/glommio/blob/master/glommio/src/executor/mod.rs#L1369), as long as there is runnable task in the current task queue, the queue will be repushed, regard less of whether it is yielded already. So I propose to take the yieldness into the consideration of need_repush(https://github.com/DataDog/glommio/blob/master/glommio/src/executor/mod.rs#L1423).

@ellutionist ellutionist changed the title yield_task_queue_now does not seem to make sence yield_task_queue_now does not seem to make sense Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant