4 ms·
To be clear: My understanding of the kernel scheduling problems Linus talked about were basically that modern OSes do a very good job and people run into proble
by corysama 6y ago
To be clear: My understanding of the kernel scheduling problems Linus talked about were basically that modern OSes do a very good job and people run into problems by trying to work around them. This is because the kernel will still move on doing it's job even if you don't coordinate with it. For example: when using lock-free queues you'll still get long, unpredictable pauses in your thread because it will still naturally get timesliced into a context switch eventually.
- Const-me 6y agoI’m pretty sure developers of OS kernels are aware of these shenanigans. Here’s the implementation of queues in Linux: https://github.com/torvalds/linux/blob/4334f30ebf395b204c6cbeabf371a5a998d6ba7c/ipc/mqueue.c https://github.com/torvalds/linux/blob/4334f30ebf395b204c6cb... I never worked on that kernel, but on the first sight it looks like they’re using a combination of locks and lock-free stuff there.