Saturday, November 22, 2014

Linux epoll

Both POSIX poll and select accepts and walks the list of fd passed over and if the list is long, this affect efficiency and performance. Linex epoll() is created to address this by separate the registration from the monitoring using different calls.

epoll works by firstly creating a polling context using epoll_create1() call.    The call returns a handle which must be freed via close() call.

fd to be monitored are then add to the context using epoll_ctl().  The events to be monitored are also specified.

Program then goes into wait for the events via the epoll_wait() call.

No comments: