From e4f11e3e19c880450d0ab4105cad041b50c093e2 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Wed, 26 Jun 2024 15:52:41 +0900 Subject: [PATCH] aio: improve comments --- src/aio/Fallback.zig | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/aio/Fallback.zig b/src/aio/Fallback.zig index adcaecb..52c44a9 100644 --- a/src/aio/Fallback.zig +++ b/src/aio/Fallback.zig @@ -7,7 +7,12 @@ const Pool = @import("common/types.zig").Pool; const FixedArrayList = @import("common/types.zig").FixedArrayList; const DoubleBufferedFixedArrayList = @import("common/types.zig").DoubleBufferedFixedArrayList; -// This mess of a code just shows how much io_uring was needed +// This tries to emulate io_uring functionality. +// If something does not match how it works on io_uring on linux, it should be change to match. +// While this uses readiness before performing the requests, the io_uring model is not particularily +// suited for readiness, thus don't expect this fallback to be particularily effecient. +// However it might be still more pleasant experience than (e)poll/kqueueing away as the behaviour should be +// more or less consistent. pub const EventSource = posix.EventSource; @@ -30,11 +35,12 @@ pub fn isSupported(_: []const type) bool { } fn minThreads() u32 { - // might need this on BSD too. - // it's not a great solution, but this at least lets apps that poll /dev/tty - // work with one dedicated thread given for it. - // unfortunately pselect/select which will work on /dev/tty are just too annoying - // to try and kludge into this backend. + // Might need this on BSD too. + // It's not a great solution, but this at least lets apps that poll /dev/tty work + // with one dedicated thread given for it. Unfortunately pselect/select which will + // work on /dev/tty are just too annoying to try and kludge into this backend.A + // + // return if (builtin.target.isDarwin()) 2 else 1; }