Precision of `threadDelay` with -threaded could be increased on Linux
threadDelay takes a sleep duration as a number of microseconds, but the implementation used on Linux when
-theaded is specified uses much coarser precision, leading to surprise.
When using the
epoll backend, the timer manager uses the
timeout argument to
epoll_wait to service
threadDelay requests. However, this has only millisecond precision, and it's also round up to the system clock granularity.
epoll backend maintains a timer fd (created using
timerfd_create), and uses it whenever a finite timeout is requested.