1 / 11

ACTORS

ACTORS. Motivation. Develop language for concurrency “ Parallel Execution of actions ” . Brief History. A number of individuals have contributed to the development of the actor model. Actor model was first described by Carl Hewitt (70 ’ s)

yasuo
Download Presentation

ACTORS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ACTORS

  2. Motivation • Develop language for concurrency “Parallel Execution of actions”.

  3. Brief History • A number of individuals have contributed to the development of the actor model. • Actor model was first described by Carl Hewitt (70’s) • The model was object-oriented: every object was a computationally active entity capable of receiving and reacting to messages. The Objects were called Actors. • Gul Agha, later develop the actor model and develop a mathematical theory of actors.

  4. What are actors ? Actors are independent concurrent objects that interact by sending asynchronous messages; each actor has its mail address and a behavior. An actor can do the following: • Send communication to other actors. • Create new actors. • Define a new behavior for itself, which may be the same or different to its previous behavior.

  5. Behavior change • Higher level than state change (assignment) • The current behavior of an actor will specify its replacement behavior • How it will perform the next incoming message • A behavior accepts only one message • A causally connected chain of behaviors isomorphic to the queue of messages

  6. Mail System Two important facts about mail system in the actor system: • Mail arrives in random, non deterministic order (asynchronous). • Ensures concurrent execution. • The mail delivery is guaranteed. • The system guarantees to execute all tasks eventually.

  7. Communication Mechanisms • Communication is asynchronous, without any guaranteed arrival order. • Message order: if actor A sends a sequence of communications to actor B, then B may not receive them in the same order that A sent them. • It is possible for A to tag each message with a sequence number, so that B may rearrange messages into the correct order.

  8. Extending the Actalk framework towards ACTORS ActorBehavior subclass: #AghaActorBehavior setProcess [self acceptNextMessage] fork replace: replacementBehavior aself initializeBehavior: replacementBehavior

  9. Example AghaActorBehavior subclass: #AghaCounter instanceVariables: ‘contents’ consultAndReplyTo: replyDestination self replace: (self class contents: contents). replyDestination reply: contents incr self replace: (self class contents: contents + 1) reset self replace: (self class contents: 0)

  10. References • Agha, Gul, Actors: A Model of Concurrent Computation in Distributed Systems. MIT Press, 1986, 144 p. • Open Systems Laboratory • http://osl.cs.uiuc.edu/

More Related