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.