3 ms·
Consider the situation "counter = counter + get_value()". That also can be reasoned about in terms of smaller operations, but not more coarse operations, becaus
by Thorrez 5y ago
Consider the situation "counter = counter + get_value()". That also can be reasoned about in terms of smaller operations, but not more coarse operations, because the user could have just written the single operation.
We wouldn't expect this to be atomic, because the get_value() function could do tons of things, and we don't expect all that to be atomic. It doesn't make sense to call something atomic just because the user wrote it.