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

Poll on the 0th tick, check external queue on 32nd #4270

Open
wants to merge 1 commit into
base: series/3.6.x
Choose a base branch
from

Conversation

armanbilge
Copy link
Member

Refactors the worker thread runloop so that I/O polling and external queue polling are no longer part of the same tick, and instead occur at opposite ends of the loop i.e. the 0th and 32nd ticks. The goal is to reduce the chance that the local queue overflows, by giving it a chance to work on tasks in-between polling these sources.

@armanbilge armanbilge requested a review from djspiewak February 8, 2025 18:46
Comment on lines +765 to +766
if ((tick & ExternalWorkTicksMask) == 0) {
if ((tick & PollingTicksMask) == 0) {
Copy link
Member Author

Choose a reason for hiding this comment

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

There's a couple ways we could encode this 🤷

Also, random idea: what if we just completely unrolled the 64 ticks of the worker loop?

@armanbilge armanbilge added this to the v3.6.0 milestone Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant