|
|
|
|
|
by Twey
92 days ago
|
|
The operations are atomic because of the single-threaded nature of actors. But the operations can be arbitrarily ordered, except for the pairwise ordering constraint (which mirrors the happens-before relation on memory within a thread). If your memory actor has operations like ‘read address’ and ‘write address’ then yes, you precisely get the behaviour we enjoy from shared memory: if you read one address A then address B someone might have changed both of them in the meantime, and if you write A then read it back it might have been changed in the meantime. The difference is that you're not limited to just ‘read address’ and ‘write address’ operations: the shared actor gets to define higher-level operations that are atomic over larger sections of code. |
|