Logo

Programming-Idioms

History of Idiom 33 > diff from v23 to v24

Edit summary for version 24 by tkoenig:
New Fortran implementation by user [tkoenig]

Version 23

2019-01-24, 10:57:30

Version 24

2019-09-27, 22:35:41

Idiom #33 Atomically read and update variable

Assign variable x the new value f(x), making sure that no other thread may modify x between the read and the write.

Idiom #33 Atomically read and update variable

Assign variable x the new value f(x), making sure that no other thread may modify x between the read and the write.

Code
x = f(x)
Comments bubble
This is for a normal variable. In Fortran, normal variables which are not coarrays cannot be changed by another image.