Both kqueue and epoll have read, write, and error events.
In the process of using both, it is found that the kqueue has reasonable control over the event, and epoll needs to carefully read the document and practice to know what is going on.
1. enable one event
Epoll activates an event through epoll_ctl_mod. Note that there is a read event in epoll, and only the write event is passed during mod. This is the time when only the write event is in epoll, the read event does not exist.
Kqueue can activate an event through ev_enable without affecting registered events.
2. Disable 1 event
Epoll:
Re-epoll_ctl_mod to remove the events to be disabled,
Events = registeredevents &(~ Disableevents)
Did I make a mistake? This is a strange practice.
Kqueue uses ev_disable to easily disable an event.
3. delete an event
Epoll uses epoll_ctl_del. Whether the events are uploaded or not, epoll deletes all events internally!
Kqueue has an ev_delete option that can be used to delete an event.
For details about kqueue, refer:
Http://www.ibm.com/developerworks/cn/aix/library/1105_huangrg_kqueue/