> how can a message be 'lost' from a mailbox without any explicit 'read-message-from-mailbox' call from the actor itself.
It depends on the implementation of actors. If an actor is represented as a thread/fiber then an actor is responsible to call `receive` method from time to time. The only example of such an approach I know in the C++ world is Just::Thread Pro library. But even in that case, a message can be ignored if a user writes the wrong if-then chain (or `switch` statement).
But actors often implemented as an object with callbacks those are called by actor framework at the appropriate time. List of callbacks can differ from state to state.
There are at least two corner cases in real-world usage of actors:
* traceability of an application (or part of the application). For example, you send a message and don't see any reaction to it. Why? Was this message lost (sent nowhere)? Was it ignored by the receiver (or received by a different actor)? Was it received by the right receiver but handled incorrectly? It could be hard to find an answer, especially if there are millions of actors in your app.
* testability of your actors. Writing a unit-test for an actor can be a more complex task than testing some C++ function or class.
I think a good actor framework should provide tools for simplification of such tasks. And I can't image that those topics will sometime be covered by a C++ standard.
> once message delivery is guaranteed to be in-order and lossless, then for the above scenario the issue is 'obviously' on the sender side.
It depends on how the receiver handles incoming messages:
* there could be a scheme where a message is lost if it isn't handled in the current actor's state (or if it isn't deferred explicitly);
* there could be a scheme where a message that is not handled in the current state is deferred automatically (for example, Erlang's selective receive).
The problem I described exists for the first case but isn't actual for the second. However, schemes with selective receive can have their own drawbacks.
> it can be easily solved with timers where 'A' expects to move from state-a to state-b in say 'n' seconds after startup etc.
The main problem is: a developer should understand that problem and should implement that in code. But people make mistakes...
> Message passing definitely doesn't eliminate race conditions or deadlocks.
You mention two very different problems.
1. Data race. It's a problem of mutation of some shared state. This problem is illuminated in the actor's approach by removing the shared state completely. Every actor has its own state and the only actor can change during handling incoming messages.
Even if we don't speak about actors and use message-passing within some other model (like CSP or Pub/Sub) then it hard to imagine how data race can happen in 1-to-1 interaction between entities in your application.
Or such thing as miss of a message. For example, actor A starts in state S1(A) and waits for message M1 to switch to state S2(A) where it will wait for M2. But actor B sends messages to A in reverse order: M2, then M1. If message M2 is not deferred by A, then M2 will be ignored by A in S1(A), then A switches to S2(A) and will wait for M2, but that message won't go to it.
In that case, if you receive M2 before M1 the instance of M2 will be kept in the queue.
But if you have to write something like that:
then you can easily lose a message by a mistake.