3 ms·
Building a Tiny Mutex
- ratorx 4y agoGreat article! Covers a lot of interesting concepts. I think it would have been really nice to justify the extra size tradeoff from the spin lock onwards (with benchmarks). So as you add code, you really justify it with the impact it has on code size and the (extra) performance it brings. I think it would have been really helpful to visualise the exact impact of each change. Another thing you could do with this approach is to include the extra optimisations that didn’t work that you talked about. Would have been really cool to see a “failed” strategy at improving performance, with an explanation of why it didn’t work.
- ameixaseca 4y agoPlease stop this madness of spinlocks in userspace. They are inefficient and conceptually incorrect for the absolute majority of applications. If you are.. * not writing a kernel; * not running your tasks with SCHED_FIFO and not running individual tasks pinned to individual cores; .. then you should not even think about spinlocks. They will waste resources and perform very poorly. Linus' rant [1] is not a rant but a detailed explanation of how real world process scheduling works, and should serve as a good reminder of what happens if you disregard basic computer science knowledge when writing software. [1] https://www.realworldtech.com/forum/?threadid=189711&curpostid=189752 https://www.realworldtech.com/forum/?threadid=189711&curpost...
- deleted 4y ago[deleted]