Questions tagged [actor-model]

The actor model in computer science is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent computation: in response to a message that it receives, an actor can make local decisions, create more actors, send more messages, and determine how to respond to the next message received.

The actor model in computer science is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent computation: in response to a message that it receives, an actor can make local decisions, create more actors, send more messages, and determine how to respond to the next message received.

The Actor model adopts the philosophy that everything is an actor. This is similar to the everything is an object philosophy used by some object-oriented programming languages, but differs in that object-oriented software is typically executed sequentially, while the Actor model is inherently concurrent.

An actor is a computational entity that, in response to a message it receives, can concurrently:

  • send a finite number of messages to other actors;
  • create a finite number of new actors;
  • designate the behavior to be used for the next message it receives.

There is no assumed sequence to the above actions and they could be carried out in parallel.

Decoupling the sender from communications sent was a fundamental advance of the Actor model enabling asynchronous communication and control structures as patterns of passing messages.

Recipients of messages are identified by address, sometimes called "mailing address". Thus an actor can only communicate with actors whose addresses it has. It can obtain those from a message it receives, or if the address is for an actor it has itself created.

The Actor model is characterized by inherent concurrency of computation within and among actors, dynamic creation of actors, inclusion of actor addresses in messages, and interaction only through direct asynchronous message passing with no restriction on message arrival order.

References:

70 questions
49
votes
4 answers

When should one use the Actor model?

When should the Actor Model be used? It certainly doesn't guarantee deadlock-free environment. Actor A can wait for a message from B while B waits for A. Also, if an actor has to make sure its message was processed before moving on to its next…
19
votes
2 answers

Actor model vs object oriented model

I searched in the web for a long time and couldn't find the concrete disadvantages of object oriented model which are overcome in Actor model. Please help me with some pointers and explanations on it. Thanks in advance.
Suga Raj
  • 481
  • 3
  • 15
13
votes
2 answers

How does Scala attain parallelism?

I am taking a course on distributed systems and we have to make our project using Scala. Our instructor told us that Scala is good in the sense that it uses multiple cores to do the computation and uses parallelism to solve problems while being…
java_doctor_101
  • 3,287
  • 4
  • 46
  • 78
12
votes
1 answer

Is it possible/advisable to have a different supervision strategy for different children of an Akka 2 actor?

I'm playing with Akka and I have a design in which a supervisor actor has a child playing role A and several children playing role B. I want to define a supervision policy such as A failures are escalated (terminating the supervisor) and B ones…
sortega
  • 1,128
  • 9
  • 15
12
votes
1 answer

Is Communicating Sequential Processes [CSP] an alternative to the actor model in Scala?

In a 1978 Paper by Hoare we have an idea called Communicating Sequential Processes. This is used by Go, Occam, and in Clojure in core.async. Is it possible to use CSP as an alternative to the Actor Model in Scala? (I'm seeing JCSP but I'm wondering…
hawkeye
  • 34,745
  • 30
  • 150
  • 304
10
votes
3 answers

What is actor model in context of a programming language?

I've seen it mentioned in several places in contexts like Erlang actor model, Groovy actors, Scala actor model etc. What does this refer to?
Vasil
  • 36,468
  • 26
  • 90
  • 114
10
votes
2 answers

Actor model and collision detection

I'm just thinking about possibility of Erlang for game server. (oh I'm not Erlang expert, just considering stage) This means using Actor Model for game simulation. Of course, most biggest attraction is its concurrency distributed over multiple…
eonil
  • 83,476
  • 81
  • 317
  • 516
9
votes
5 answers

How would you explain actors to a non-programmer?

Well, the title's pretty much it: if I sat a non-techie/my mum/twelve-year old boy/cocker spaniel in front of you and asked you to explain actors to them, where would you start? I ask because my master's project involves them to a pretty large…
Samir Talwar
  • 14,220
  • 3
  • 41
  • 65
8
votes
3 answers

What's the difference betwee "Actor model" and "Reactor pattern" in Python?

https://en.wikipedia.org/wiki/Actor_model, the project is called "pulsar" https://en.wikipedia.org/wiki/Reactor_pattern, the projects are Twisted and Tornado What's the difference in the theory and practice?
est
  • 11,429
  • 14
  • 70
  • 118
7
votes
1 answer

Do web workers use actor model?

I have been trying to understand how actor model and web workers work. In https://dzone.com/articles/html5-web-workers-classic: "Web Workers provide a message-passing model, where scripts can communicate only through well-defined immutable…
6
votes
1 answer

Python actor model: thespian vs pykka

I want to play around with actors in python. Apparently, the two most popular alternatives are thespian and pykka. I'm looking for something actively developed and easy to use. Which would you recommend and why?
Gabriele
  • 469
  • 4
  • 10
6
votes
1 answer

Actor Model for instant messaging app?

i have a background in enterprise distributed systems using Messaging technologies such as RabbitMQ and others, though i am relatively new to Actor Model. with that said, i am wondering if it is a good idea to use the Actor Model frameworks such as…
SHM
  • 1,896
  • 19
  • 48
6
votes
3 answers

If scala advocate immutability why it adopted actor model with its mutable nature?

I am new in scala and actor world. This is what I've learned so far: Scala is functional programming (not purely) and people advice not to use mutable state in scala. But on another hand, there is akka framework which implements actor model. And…
6
votes
2 answers

Akka. How to illustrate actors in UML?

How I can illustrate Akka actors in UML diagrams? Especially how to illustrate messages passed between actors? Any example will be fine. Thanks.
WelcomeTo
  • 19,843
  • 53
  • 170
  • 286
5
votes
1 answer

How Arbiters from the actor model are implemented in Erlang?

I know that Erlang uses Actor model to support concurrency and Erlang processes are the same as Actors: they send messages, immutable and so on. But according to Carl Hewitt one important thing in the Actor Model is indeterminism and Arbiters (Given…
1
2 3 4 5