Atomation as a concept occurs in several places, I suspect that you are thinking about atomic operations in the code, but there are other meanings.
One fundamental property of a database transaction is Atomicity, see ACID for transaction properties.
In this case, you have a lot of skills, locks, etc., which almost certainly involves waiting when two control flows (or two processes) want to receive the same data.
When you come to the lines of code, I think you are thinking of a declaration (in some dummy language)
global int x = 7;
in one thread
x = 25000; print x;
and in another
print x;
Can we say something about what the second stream will print? We could take 7 or 25000, we would be less happy to get a number that was a high order byte of 25,000 and a low byte of 7, which conceptually would be the result of the non-atomic assignment of integers.
Different programming languages โโcan freely define any semantics that they desire, it can be assumed that some of them will simply agree with any natural behavior in which the processor works (say, 32-bit int was atomic, 64-bit was not long), or they can do something smarter, and if the CPU itself does not provide atomic operations, then I do not see much alternative to the expected expectation, if they want to fake atomicity - for example. Java synchronized keyword.
djna
source share