Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for December 5, 2013
Deadline scheduling: coming soon?
LWN.net Weekly Edition for November 27, 2013
ACPI for ARM?
LWN.net Weekly Edition for November 21, 2013
Posted Apr 2, 2013 9:17 UTC (Tue) by tialaramex (subscriber, #21167)
So perhaps C could consider offering swap with no promises of atomicity, plus a set of reserved pre-processor variables which tell us whether atomicity is implemented for specific types. This would let you do
#error This program requires an atomic swap for unsigned 64-bit integers but you don't have one. Too bad.
... or something more useful, but you get the idea.
Posted Apr 2, 2013 20:12 UTC (Tue) by scottwood (guest, #74349)
Posted Apr 3, 2013 5:05 UTC (Wed) by Ben_P (subscriber, #74247)
Posted Apr 5, 2013 23:18 UTC (Fri) by mathstuf (subscriber, #69389)
Posted Apr 2, 2013 20:31 UTC (Tue) by wahern (subscriber, #37304)
I suspect that they're uncommon if not non-existent.
In any event, presumably such an operation was left out of the stdatomic.h libraries for C11 and C++11 for a reason.
Posted Apr 3, 2013 11:04 UTC (Wed) by heijo (guest, #88363)
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds