← BYTES
Unix IPC·Starter·Ref: 15.1.54
At a basic level, what is the difference between epoll's 'level-triggered' and 'edge-triggered' modes?
Have a question about this video? Mention reference 15.1.54 when you contact us.
LEVEL-TRIGGERED: keeps telling you "still ready!" every time you ask EDGE-TRIGGERED: tells you ONCE, right when it just became ready
a.There is no real difference between the two modes
b.Level-triggered (the default) keeps reporting a file descriptor as ready for as long as the underlying condition remains true (e.g. unread data still sitting in the buffer); edge-triggered reports it only once, at the moment the condition first becomes true, and won't report it again until the state changes again
c.Edge-triggered mode can only be used with files, never sockets
d.Level-triggered mode is exclusively available on 32-bit systems
Level-triggered (epoll's default) is the more forgiving mode: it'll keep telling you a fd is ready every time you ask, as long as it actually still is. Edge-triggered only notifies once, right when readiness first appears -- placing more responsibility on the application to fully drain the available data/buffer space before the next transition, a tradeoff covered further in the intermediate section.
Find this on YouTube & Instagram
Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:
#BYTES#BYTES15154#UnixIPC