-
Notifications
You must be signed in to change notification settings - Fork 2
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
Read multiple bytes for system events #10
Conversation
Thanks for your contribution, I'll try to double check the code again on Monday, but it looks OK to me. There is another approach that may be worth considering:
I suspect that VSCode sends the whole header in one go (and maybe also the payload). In this way the number of iterations of the loop pulling ready events is going to decrease substantially. |
I took me a while, but here the result:
Both tests fail in main, and work in this branch. I think that the behavior is now: when an system event starts to make progress, we guarantee we give it enough rounds to complete if his priority is the lowest among the events that are ready or made progress in the previous round. In particular a system even with lower priority than a ready task (Sel.now) does complete (if there is enough data to read). |
When checking for system events, the current version would read
1
byte per iteration, meaning that when other tasks are ready, readingn
bytes becomes interleaved withn
other tasks. These tasks may be slow, resulting in unnecessary slowdowns of system events (such as UI events in vscoq).This change allows reading another byte from its file descriptor when: