Yes. Lockless is quite simple in theory but gets really difficult in the real world (say, where ring buffers actually wrap). You thought threading was hard to prove correct, debug, and maintain? Lockless is harder in every way. I converted a small event-based networking app I wrote two years ago to use lockless lists. It was fun but ultimately a waste of time... It didn't run much faster but now it contained subtle boundary conditions that, when violated by an unwary programmer, resulted in occasional corruptions under load. Good luck trying to debug that (don't bother stepping through it in gdb)! There are a few areas where lockless really is worth it, especially when you have a hot, high-contention buffer or stack. But be prepared for some tough maintenance.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds