The data structure of libev watchers
- by changchang
Libev uses three data structures to storage different watchers.
Heap: for watchers that sorted by time, such as ev_timer and ev_periodic.
Linked list: such as ev_io, ev_signal, ev_child and etc.
Array: such as ev_prepare, ev_check, ev_async and etc.
There is no doubt about that uses heap to store timer watcher. But what is the criteria of…