linux

When using epoll, you can choose between level-triggered (LT) and edge-triggered (ET) modes, which define how and when you are notified about I/O events.

Level triggred

  • You get notified as long as the file descriptor is in a ready state.
  • If you don’t consume all available data (for example, don’t read the whole buffer), epoll_waitwill keep notifying you

“I’ll keep reminding you until you deal with the problem.”

Edge triggred

  • You get notified only once when the file descriptor transitions from not-ready to ready.
  • If you don’t consume all the data immediately, you will not be notified again.

“I’ll tell you once, and you better deal with it completely.”

Python

https://docs.python.org/3/library/selectors.html#module-selectors https://docs.python.org/3/library/select.html#select.epoll