|
|
Subscribe / Log in / New account

Lockless algorithms for mere mortals

Lockless algorithms for mere mortals

Posted Jul 29, 2020 21:55 UTC (Wed) by rweikusat2 (subscriber, #117920)
In reply to: Lockless algorithms for mere mortals by Paf
Parent article: Lockless algorithms for mere mortals

It doesn't say anything about different types of memory barriers and very intentionally so: It explains the basic problem which is supposed to be solved, including the need for barrier pairing, in sufficient detail that simple, lockless algorithms can be implemented based on this level of understanding. And even getting this out of memory-barrier.txt literally required a few years of head-scratching.

This kind of "formalistic explanations" aka "wild letter salad" are essentially write-only text. All of the constructs supposedly explained in the file are used in real code in the kernel. The documentation could be greatly improved by using real examples to explain the different semantics.


to post comments

Lockless algorithms for mere mortals

Posted Jul 29, 2020 22:25 UTC (Wed) by Paf (subscriber, #91811) [Link] (1 responses)

Right, so it doesn’t give the required level of detail for optimized implementations, which is what memory-barriers.txt is doing.

I’m all for specific examples and I agree memory-barriers.txt is bordering on unusable, but what you suggested is still too simple to replace it.

Lockless algorithms for mere mortals

Posted Jul 31, 2020 16:56 UTC (Fri) by PaulMcKenney (✭ supporter ✭, #9624) [Link]

One of the motivations for LKMM was the increasing difficulty of dealing with memory-barriers.txt. In fact, LKMM is intended to be an automated replacement for large portions of memory-barriers.txt.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds