LWN.net Logo

Introducing lockrefs

Introducing lockrefs

Posted Sep 6, 2013 13:57 UTC (Fri) by corbet (editor, #1)
In reply to: Introducing lockrefs by peter-b
Parent article: Introducing lockrefs

I'm not quite sure where you got the impression that I've not seen that sort of operation before?


(Log in to post comments)

Introducing lockrefs

Posted Sep 6, 2013 14:07 UTC (Fri) by peter-b (subscriber, #66996) [Link]

I think it was the slightly breathless description of CMPXCHG as "magic". I apologize for maligning you!

BTW, people who want to play with CAS may find it more convenient to use GCC's built in __sync_bool_compare_and_swap() than to writing assembly sections.

Introducing lockrefs

Posted Sep 6, 2013 21:41 UTC (Fri) by madscientist (subscriber, #16861) [Link]

I think our Fearless Editor was referring to the implementation of the macro as magic (probably based on looking at what it expands to), not the concept of CAS as magic.

Introducing lockrefs

Posted Sep 6, 2013 21:46 UTC (Fri) by helsleym (subscriber, #92730) [Link]

My guess is the author was writing for a wider audience for whom these types of primitive operations are often unfamiliar. I always liked using the word "arcane" in this context.

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