Felix Palmen :freebsd: :c64:<p><span class="h-card" translate="no"><a href="https://mastodon.bsd.cafe/@jan" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>jan</span></a></span> funnily, the lack of <a href="https://mastodon.bsd.cafe/tags/POSIX" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>POSIX</span></a> <a href="https://mastodon.bsd.cafe/tags/timers" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>timers</span></a> in <a href="https://mastodon.bsd.cafe/tags/OpenBSD" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>OpenBSD</span></a> inspired me to come up with a timer implementation supporting different backends. I was annoyed at first, but didn't regret it. The interface offered by POSIX timers is really clumsy, they can either send some signal or (even worse) launch a thread. My current code only uses them on <a href="https://mastodon.bsd.cafe/tags/illumos" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>illumos</span></a>, which offers a better signaling mechanism on an "event port". Where available, <a href="https://mastodon.bsd.cafe/tags/kqueue" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>kqueue</span></a> is used for timers. the next fallback is <a href="https://mastodon.bsd.cafe/tags/Linux" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Linux</span></a>' <a href="https://mastodon.bsd.cafe/tags/timerfd" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>timerfd</span></a>. And finally, as a last resort, some manual multiplexing on top of <a href="https://mastodon.bsd.cafe/tags/setitimer" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>setitimer</span></a> (cause it's not much worse than "vanilla" POSIX timers).</p><p>tl;dr, might be an alternative to contribute code to upstream enabling them to use better platform interfaces for timers...</p>