|
|
|
|
|
by o11c
896 days ago
|
|
A point that people seem to miss: epoll supports both level-triggered and edge-triggered. Most similar APIs only support level-triggered. Edge-triggered is theoretically less work for the kernel than level-triggered, but requires that your application not be buggy. People tend to either assume "nobody uses edge-triggered" or "everybody uses edge-triggered". Completion-based is far from trivial; since the memory traffic can happen at any time, the kernel has to consider "what if somebody changes the memory map between the start syscall and the end syscall". It complicates the application too, since now you have to keep ownership of a buffer but you aren't allowed to touch it. AIX and Solaris apparently also support completion-based APIs, but I've never seen anyone actually run these OSes. (aside, `poll` is the easiest API to use for just a few file descriptors, and `select` is more flexible than it appears if you ignore the value-based API assumptions and do your own allocation) |
|