Implement high-resolution timer infrastructure for task scheduling #69
Labels
area: common
Issues related to the shared utility APIs.
state: approved
Enhancements and tasks that have been approved.
Milestone
Task.Delay()
has around ~15 ms of overhead on Windows and ~10 ms on Linux. This is likely to be too much for some combat simulation tasks in the world server.On Windows, we can implement a custom timer queue backed by
CreateWaitableTimerExW
(with theCREATE_WAITABLE_TIMER_HIGH_RESOLUTION
flag) andSetWaitableTimer
(with negativelpDueTime
to avoid clock skew).On Linux, we can use
clock_nanosleep
(withCLOCK_MONOTONIC_RAW
to avoid clock skew) in a dedicated thread. We would need to send the thread a signal withpthread_kill
when the due time needs to be updated.The text was updated successfully, but these errors were encountered: