What about edge-triggered notification?
What about edge-triggered notification?
Posted Jan 19, 2018 19:03 UTC (Fri) by davmac (guest, #114522)In reply to: What about edge-triggered notification? by pbonzini
Parent article: A new kernel polling interface
From the article:
> AIO poll operations always operate in the "one-shot" mode
While "one-shot" isn't precisely the same thing as edge-triggered, they can largely be used with similar effect. If you want edge triggering and you have one-shot, you can arm a level-triggered one-shot listener and it will fire either immediately on the next "up" edge. Your application is in control of the "down" edge (i.e. you read all the data from the socket until you receive EAGAIN) and if you re-arm after that point, you effectively get notified of the next "up" edge in the same way that edge-triggered notification would.
The main differences are that (a) you have to explicitly re-arm and (b) you won't get extra notifications if you happen to get two edges while processing (i.e. if you drain all data from the socket but more comes in before you do another read and notice that the buffer is empty). The (a) point is a down-side, but (b) is pretty much essential if you want to poll for events from multiple threads, since you can otherwise end up with more than one thread trying to service the same active connection.
Posted Aug 27, 2018 23:50 UTC (Mon)
by ncm (guest, #165)
[Link] (1 responses)
Posted Aug 29, 2018 9:23 UTC (Wed)
by farnz (subscriber, #17727)
[Link]
You can set that up with level-triggered notifications; use a software mutex mechanism to stop things happening in parallel on one event source if necessary, then ask for a new notification immediately upon receiving one (or at a good point in your processing of incoming events), and you will be notified of new events that happen while you're processing the older ones.
This is basically how the IRQ controller on hardware that resignals edge-triggered interrupts that came in while interrupts are blocked works - bear in mind that on some (older) IRQ controllers, edge-triggered interrupts that came in while interrupts are still blocked would simply be lost by the hardware due to the race between unblocking and the interrupt arriving.
What about edge-triggered notification?
What about edge-triggered notification?
