A race condition:
Two processes intend to add two to a number.
They each read the current value.
Then they each write back the value which is two bigger then the original.
If you instead use private fields and public getters/setters, or use actors to form a protective bubble around the mutable state, you get...The exact same thing but with more boilerplate.
This article is about actors in the Swift programming language, and I’d answer the question (“is a stateless actor pointless?”) differently: there is no such thing as a stateless actor in Swift.
Every actor in Swift conforms to the Actor protocol, which has one requirement: an instance property named `unownedExecutor`. Swift uses this property implicitly when, for example, the program calls a method on the actor from outside the actor.
https://developer.apple.com/documentation/swift/actor/unowne...
(One could also argue that, because every actor type is a reference type, every actor also has its identity as part of its state.)