Of course, some programs don't expect this.
Fun story, me and my little sister played a game online years ago. The Mana World. A game with an OpenBSD port. She teamed up with some guy in game. She also told me that guy had a terrible internet connection & slow PC. So once I found them, I watched this guy lag and move about in slow motion. I asked if he's running OpenBSD. He said he's running OpenBSD. I sent him a little patch and it's like he got a new PC and a new internet connection, just like that.. :-)
Like I said, it was years ago. If I still have the patch, it's got to be on one of these spinning rust disks sitting in my closet. I'm on a trip so I really can't look for it now.
Assuming the client is still buggy (things like SDL2 have happened so who knows?), I'd probably look here first:
https://gitlab.com/manaplus/manaplus/blob/485e9bb12bf5dda318...
The logic won't run right if the timer is implemented with a sleep that ends up sleeping much longer than intended. If it works like it did back then (sleep is virtually always 20ms), simply incrementing the tick count by two every time should be enough to make it smooth on OpenBSD. Of course the correct fix is to keep track of actual time spent and adjust ticks accordingly. Or use a timer mechanism that has higher precision. IIRC setitimer[1] can get you a regular 100Hz alarm on OpenBSD.
http://man.openbsd.org/setitimer.2
If I'm not entirely mistaken, the old userspace implementation of pthreads worked with a 100Hz timer using this mechanism.
0.017686
0.031868
0.055889
0.008931
0.014824
However, when I set the kern.timecounter.alloweddeviation sysctl ("Allowed time interval deviation in percents") to 0 (from the default of 5%), I get very low and consistently low latency: 0.000036
0.000031
0.000030
0.000037
0.000036
0.000040
There are pros and cons to both defaults.Why make wakeup imprecise by default? The slop allows for some coalescing of nearby (in time) events into a single wakeup, saving power[0]. This article provides some figures that give a good intuition for why this might work: https://arstechnica.com/gadgets/2013/06/how-os-x-mavericks-w...
See also: tickless kernels in general[1]; FreeBSD switched to a tickless kernel with coalescing about 5.5 years ago[2].
[0]: https://en.wikipedia.org/wiki/Timer_coalescing
[1]: https://en.wikipedia.org/wiki/Tickless_kernel
[2]: https://svnweb.freebsd.org/base?view=revision&revision=24777...
I don't know if this is what loeg had in mind, and I have not investigated the subject myself.