8 ms·
Maybe, but only if you are doing it wrong. Pro-tip: look up hashed wheel timers.
by ComputerGuru 7y ago
Maybe, but only if you are doing it wrong. Pro-tip: look up hashed wheel timers.
- monocasa 7y agoPro tip: implementing a hashed wheel timer yourself in user space comes with weird jitter because you can't atomically grab the system time and sleep for the next tick. Which is why all the sane OSes implement it or something like it in kernel space, including NT.
- ComputerGuru 7y agoIt’s not about implementing it more efficiently in a universal sense, it’s about making fewer unnecessary trips to the kernel and back. Context switches probably introduce more jitter than your userspace hashed timer wheel.