]> mj.ucw.cz Git - libucw.git/commit
Main: Optimize calls to epoll_ctl()
authorMartin Mares <mj@ucw.cz>
Fri, 30 Jul 2010 18:42:57 +0000 (20:42 +0200)
committerMartin Mares <mj@ucw.cz>
Wed, 18 Aug 2010 16:12:58 +0000 (18:12 +0200)
commitc535433982fdbe2e0eae6ae850c3998e461ef5eb
treedc4d4ffcdb1c8c749ab7defc4e1706fc583cc824
parent1d6a9a1fe4e2a62194c62aa756833b96c6807a7e
Main: Optimize calls to epoll_ctl()

It often happens that a file callback is removed and then reinstated
again before the next main loop iteration (e.g., on a boundary between
two blocks if block_io is used). This caused lots of unnecessary
calls to epoll_ctl().

We now put all files on which file_chg() was called to a separate list
and just before we call epoll_wait(), we process this list and check
which files have changed their event mask since the last iteration.
ucw/mainloop.c
ucw/mainloop.h