| Solution from the article: Don't fiddle with thread priorities. Solution that works well in real life: Use lock-free (or, better still, wait-free) data structures. The trick is that, for those of us in the devices and media world, and despite not always using RT schedulers, we generally need (largely) consistently prioritized performance for critical operations. For example, I actually need my device audio buffer callback to be timely to avoid displeasing gaps. How have whole industries managed to deliver sellable products in these spaces without resorting to RT kernels? In many cases, careful uses of thread priorities and, yes, mutexes, have been involved. This article feels like it was written by someone half-way through: Junior engineer: Just use thread priority. Senior engineer: No! Thread priority is a minefield. Principal engineer: We're going to carefully walk through this minefield. |
I got dinged on a performance review once at Apple for negatively comparing the MacOS process and IO schedulers to Linux while I was working on Final Cut/QuickTime 10 years ago. Apparently "why can't we adapt their algorithm to our stuff, it's not a secret" is not constructive enough.