3 ms·
Actor's claim to fame is no race conditions because no shared state. Haven't you just reintroduced shared state with that approach?
by mrkeen 4y ago
Actor's claim to fame is no race conditions because no shared state. Haven't you just reintroduced shared state with that approach?
- morsch 4y agoNo. I've introduced state, but no shared state; the "next batch" var is local to the actor and not shared. Critically, the only one who updates the variable is the actor itself in its thread; it could be a plain list, and not a concurrent queue as it might be in a different multiple producer/single consumer architecture. PS -- I'll add that in Akka itself, the actor's mailbox, in which messages accumulate until the actor next gets allotted a thread, is exactly a kind of concurrent queue, at least in its default implementation.