You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe that utility operations, such as +, +=, >, >=, <, <=, etc., should be supported for atomic variables. Something like the following should be supported...
var x :atomicint;
var y :atomicint;
x =1; // x.write(1)
y = x; // y.write(x.read())
x +=1; // x.fetchAdd(1)
assert(x != y); // assert(x.read() != y.read())
Such things are convenient, even if they can be misleading (I.E x += x is not guaranteed to be atomic as they would result in two separate atomic operations) but it should be up to the user.
The text was updated successfully, but these errors were encountered:
@ronawho and I have been talking about making atomics a bit more convenient to work with from time to time as well. I think he has a good handle on what we might want to support (better than I do anyway).
Add future requesting the ability to + reduce atomics
[trivial, not reviewed]
It seems that we should be able to simply do reductions across arrays of atomics, yet this seems not to work without providing some additional helper functions yourself... This may relate somewhat to issue #8847.
I believe that utility operations, such as
+
,+=
,>
,>=
,<
,<=
, etc., should be supported for atomic variables. Something like the following should be supported...Such things are convenient, even if they can be misleading (I.E
x += x
is not guaranteed to be atomic as they would result in two separate atomic operations) but it should be up to the user.The text was updated successfully, but these errors were encountered: