Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reinstate decoupled timerfd logic in EpollEventLoop
Motivation This reinstates the parts of 1fa7a5e and a22d4ba that were reverted in 7f39142 (applies to EpollEventLoop class only), with some minor changes. It sounds like this still exhibits some testsuite failures even with the lazySet fixes, but I thought it would be good to have a PR with the "latest" version to continue to test/debug. Modification Changes are the same as before apart a few added comments and the following in EpollEventLoop#checkScheduleTaskQueueForNewDelay: - Use set instead of lazySet to avoid race condition - Avoid arming timer and entering epoll wait if a task has already expired - Switch order of calling setTimerFd and updating the nextDeadlineNanos AtomicLong within the sync block The latter two are perf refinements and should not have contributed to the issues seen. Result Performance benefits from having timerfd updates decoupled from the event loop, as originally introduced by @Scottmitch
- Loading branch information
Showing
1 changed file
with
128 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters