-
-
Notifications
You must be signed in to change notification settings - Fork 344
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
Maybe use a more efficient wakeup mechanism #1554
Comments
Right, we have to allocate a socketpair for signals. For For guest mode wakeups in #1551, I did use I guess if
For all of these, wiring them up to I agree that cross-thread wakeups and guest mode wakeups are somewhat performance sensitive. But it's not at all obvious to me that these other options actually have a performance advantage over socketpairs :-). So I guess I'd want to see that before making the code any more complicated. |
Well, hmm, I guess it wouldn't be too hard if we stopped having a But we'd still need to:
|
Though I guess using a task to process the wakeup socketpair is technically a bit dubious, exactly because there's no guarantee that it runs for the entire lifetime of our program. (For example, consider a user-created system task that does The autojump clock also uses a system task; that's another one where you kind of need it to keep running until the very end. But over here I think I argued myself into thinking that it needs to stop using a system task anyway, exactly because it's too low-level a concept to rely on tasks. One option to mitigate some of these issues would be to have two levels of system tasks: system-system tasks, that only Trio makes, and user-system tasks, and make the rule be that during shutdown it goes: This line of thought also led to this question: #1521 (comment) |
#1551 had some discussion of I/O wakeup mechanisms. For signal delivery, AFAICT we don't have any option than the current WakeupSocketpair without interpreter changes, and signals aren't delivered often enough for it to matter anyway. For cross-thread wakeups and the new guest mode wakeups, though, each of our I/O backends has a more efficient way to do a wakeup, and maybe we should use it.
EVFILT_USER
for things like this; it's only documented on FreeBSD but it appears to work the same on OS X.The text was updated successfully, but these errors were encountered: