← Back to context

Comment by dataflow

2 days ago

What's the footgun with edge triggering?

The edge in epoll edge triggering is going from has data to doesn't have data.

So the obvious loop using level triggering switched to edge will eventually lock up.

You'll read 4092bbytesbwhen there is 4093 bytes leaving 1 behind and then never get a signal again.

  • This is a blatant application bug, not an epoll issue, unless you prove otherwise.

    • It is a very, very easy mistake to make though. Nothing except edge-triggered I/O multiplexing makes it a problem not to read everything you possibly could, and it is often convenient to read less and let some other part of the code handle the rest. Forgot to call that part somehow? Oops, I/O on that socket is now screwed forever.

      2 replies →