|
|
Subscribe / Log in / New account

Lockless algorithms for mere mortals

Lockless algorithms for mere mortals

Posted Jul 31, 2020 17:55 UTC (Fri) by PaulMcKenney (✭ supporter ✭, #9624)
In reply to: Lockless algorithms for mere mortals by pbonzini
Parent article: Lockless algorithms for mere mortals

Having per-subsystem documentation of the memory-ordering use cases of particular importance to that subsystem makes a lot of sense to me! Many of the five you call out are heavily used, but even given common documentation of a given use case, many subsystems might still want to cover special cases or how that use case interacts with the rest of the subsystem.

Naming is fun. Yet another common name for Dekker synchronization is store buffering. We probably need to list the common names for each use case in the LKMM documentation.

Good point on pthread_create() and pthread_join(). The same applies to things like mod_timer() and the resulting handler function.

Your point about C11 memory_order_seq_cst does me good, given how difficult it for me and a few others to get the committee to accept that the standard should include anything in addition than sequential consistency. ;-)


to post comments

Lockless algorithms for mere mortals

Posted Jul 31, 2020 21:11 UTC (Fri) by itsmycpu (guest, #139639) [Link] (1 responses)

On x86, memory_order_seq_cst is not of practical interest because of the performance impact of the mfence instruction required in the implementation of the store operation.

Maybe it's a thing for college beginner class. ;)

Lockless algorithms for mere mortals

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

Music to my ears! And please don't keep your views secret!!! It is always better when I am not the only one defending non-memory_order_seq_cst atomics. :-)

Lockless algorithms for mere mortals

Posted Aug 1, 2020 9:25 UTC (Sat) by pbonzini (subscriber, #60935) [Link] (1 responses)

Paul, you don't know how much it means to me that you confirm that my understanding makes sense! It only took 10 years. :-)

Thank you very much!

Lockless algorithms for mere mortals

Posted Aug 2, 2020 15:39 UTC (Sun) by PaulMcKenney (✭ supporter ✭, #9624) [Link]

My fond hope is that things like the Linux-kernel memory model can shorten that time in at least some cases. ;-)


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