Personal tools

Actor Model

From MohidWiki

Revision as of 23:52, 22 January 2014 by Miranda ricardo (talk | contribs)
Jump to: navigation, search

There are several resources in the Internet explaining the Actor Model and Reactive Programing. Some videos with interesting interviews:

  • Hewitt, Meijer and Szyperski: The Actor Model (everything you wanted to know, but were afraid to ask)[1]; and
  • Francesco Cesarini and Viktor Klang on the Reactive Manifesto[2].

To read online:

  • The Reactive Manifesto[3]; and
  • Learn You Some Erlang for great good![4];

According to the WikiPedia[5] "the actor model in computer science is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent digital 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."

Actor Model in Mohikd

Supose a domain in decomposed in 3 subdomains according to the image below.

Domain in decomposed in 3 subdomains creates 3 instances of MohidWater.
Domain in decomposed in 3 subdomains.

Each subdmain is an actor that sends messages to athor actors and reactes to messages it receives. Each model has a Main Loop that progresses in time-steps. Each model sends messages with border conditions to actors that need it.

Actor MW3 is the first actor to terminate its timestep.
Actor MW3 is the first actor to terminate its timestep.
Suppose Actor MW3 is the first actor to terminate its timestep. It sends messages to other actors with border conditions. MW3 has no messages in its mailbox so it is idle. Actor MW2 has a message in its mailbox but it can not process it yet so it stays there.