Sujet : Re: Apache + mod_php performance
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.os.vmsDate : 28. Sep 2024, 00:13:06
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vd7e62$tdq8$3@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14
User-Agent : Pan/0.160 (Toresk; )
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 ...