3 ms·
>The semantic operation is increment. Why? Who defines that?
by Thorrez 5y ago
>The semantic operation is increment.
Why? Who defines that?
- chrisseaton 5y agoBecause that's what the user wrote. You can reason about the operation in terms of smaller operations (such as read, add, store) but not more coarse operations, because the user could have just written the single operation.
- Thorrez 5y agoConsider 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.