Difference between revisions of "Actor Model"
From MohidWiki
Line 10: | Line 10: | ||
</ul> | </ul> | ||
− | According to the WikiPedia[http://en.wikipedia.org/wiki/Actor_model] "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. | + | According to the WikiPedia[http://en.wikipedia.org/wiki/Actor_model] "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" (changing state). |
== Actor Model in Mohikd == | == Actor Model in Mohikd == | ||
− | [[File:am.01.png|thumb|left|alt=Domain in decomposed in 3 subdomains creates 3 instances of MohidWater.|Domain in decomposed in 3 subdomains.]]Supose a domain | + | [[File:am.01.png|thumb|left|alt=Domain in decomposed in 3 subdomains creates 3 instances of MohidWater.|Domain in decomposed in 3 subdomains.]]Supose a domain is decomposed in 3 subdomains according to the image at the left. 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 information (for example border conditions) to actors that need it.<br> |
− | [[File:am.04.png|thumb|right|alt=(4) Comment.|Name.]] | + | [[File:am.04.png|thumb|right|alt=(4) Comment.|Name.]]Lets take a look at the system in a moment all actors are computing the next timestep. Is is indertemined wich actor will terminate first (even if we know each one work load, it is impossible to know when they will terminate their computations). Even while computing they are checking their mailboxes because there are messages they can react to (for instace if they are asked if their run has ended or not). Messages they can not process stay in the queue. Messages are not processed in the order of arrival.<br> |
[[File:am.02.png|thumb|left|alt=Actor MW3 is the first actor to terminate its timestep.|(1) 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 the message stays there.<br> | [[File:am.02.png|thumb|left|alt=Actor MW3 is the first actor to terminate its timestep.|(1) 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 the message stays there.<br> | ||
Line 22: | Line 22: | ||
[[File:am.05.png|thumb|right|alt=(2) Comment.|Name.]]Comment.<br> | [[File:am.05.png|thumb|right|alt=(2) Comment.|Name.]]Comment.<br> | ||
− | [[File:am.03.png|thumb|left|alt=(3) Comment.|Name.]] | + | [[File:am.03.png|thumb|left|alt=(3) Comment.|Name.]]All actors are computing a new timestep.<br> |
− | [[File:am.04.png|thumb| | + | [[File:am.04.png|thumb|right|alt=(4) Comment.|Name.]]<br> |
Revision as of 09:26, 23 January 2014
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:
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" (changing state).
Actor Model in Mohikd
Supose a domain is decomposed in 3 subdomains according to the image at the left. 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 information (for example border conditions) to actors that need it.Lets take a look at the system in a moment all actors are computing the next timestep. Is is indertemined wich actor will terminate first (even if we know each one work load, it is impossible to know when they will terminate their computations). Even while computing they are checking their mailboxes because there are messages they can react to (for instace if they are asked if their run has ended or not). Messages they can not process stay in the queue. Messages are not processed in the order of arrival.
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 the message stays there.
Comment.
All actors are computing a new timestep.