RTS uses suboptimal ticker implementation.
For posix-based hosts we have 3 implementations of the RTS ticket/timer. See https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/rts/signals#the-rts-timer-signal
Based on this wiki page/the source we want to use:
- Pthreat based one if we have
timerfd
support. - TimerCreate(with Signals) otherwise if supported.
- setitimer based one otherwise (Again using signals)
We check for timerfd
support via HAVE_SYS_TIMERFD_H
. But it seems this is not set ever!
It's certainly not set for my system, which has the appropriate header.
So we end up using the TimerCreate implementation instead.
I assume what is missing is a check for the header during configure. But maybe we should default to the pthread based implementation anyway, even if we don't have timerfd support.