[Info-vax] Apache + mod_php performance
Lawrence D'Oliveiro
ldo at nz.invalid
Fri Sep 27 19:13:06 EDT 2024
On Fri, 27 Sep 2024 09:59:16 -0400, Arne Vajhøj wrote:
> You setup a read attention AST, it triggers and then you know that there
> are data to be read. There is no reason to make reading async then,
> because you know it will not block.
I wouldn’t bother with ASTs at all, though I would use async QIOs with I/O
status blocks. Here is my proposed control flow, which is very similar to
a *nix-style poll loop:
0) Clear the event flag you are going to use in the next step.
1) Start the initial set of async QIOs on all the channels I want to
monitor. Give them all the same event flag to set on completion (e.g. the
usual default EFN 0). Don’t specify any completion ASTs, but do specify
I/O status blocks.
2) Wait for the specified EFN to become set.
3) Clear that EFN.
4) Go through all your I/O status blocks, and process all I/Os that have
completed (status field ≠ 0). Queue new async I/Os for those channels (and
any new ones) as appropriate.
5) If you still have a nonempty set of async QIOs outstanding (i.e. a
nonempty set of channels being monitored), then go back to step 2.
Otherwise, you are shutting down, so stop.
How does that sound?
Hmmm ... I just realized ... doesn’t QIO immediately clear the EFN you
specify, before queueing the actual I/O request? That might blow the whole
thing ...
More information about the Info-vax
mailing list