This preview shows page 1-2-3 out of 9 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

DefinitionPreliminariesAdvantages of the Actor Model:History:Illustrative Actor LanguageExecution SemanticsSynchronizationRPC-like MessagingLocal Synchronization ConstraintsPatterns of Actor ProgrammingSemantic PropertiesEncapsulation and AtomicityFairnessLocation TransparencyImplementationsToolsExtensions and AbstractionsPattern-directed communicationCoordinationCurrent Status and PerspectiveReferencesDRAFTActorsRajesh K. Karmani, Gul AghaOpen Systems LaboratoryDepartment of Computer ScienceUniversity of Illinois at Urbana-Champaign{rkumar8, agha}@illinois.eduI. DEFINITIONActors is a model of concurrent computation for devel-oping parallel, distributed and mobile systems. Each actoris an autonomous object that operates concurrently andasynchronously, receiving and sending messages to otheractors, creating new actors, and updating its own local state.An actor system consists of a collection of actors, some ofwhom may send messages to, or receive messages from,actors outside the system.II. PRELIMINARIESAn actor has a name that is globally unique and abehavior which determines its actions. In order to sendan actor a message, the actor’s name must be used; aname cannot be guessed but it may be communicated in amessage. When an idle is idle, and it has a pending message,the actor accepts the message, and does the computationdefined by its behavior. As a result the actor may takethree types of actions: send messages, create new actors,and update its local state. An actor’s behavior may changeas it modifies its local state. Actors do not share state:an actor must explicitly send a message to another actorin order to affect the latter’s behavior. Each actor carriesout its actions concurrently (and asynchronously) with otheractors. Moreover, the path a message takes, as well asnetwork delays it may encounter, are not specified. Thus thearrival order of messages is indeterminate. The key semanticproperties of the standard Actor model are encapsulation ofstate and atomic execution of a method in response to amessage, fairness in scheduling actors and in the deliveryof messages, and location transparency enabling distributedexecution and mobility.A. Advantages of the Actor Model:In the object-oriented programming paradigm, an objectencapsulates data and behavior. This separates the interfaceof an object (what an object does) from the its representation(how it does it). Such separation enables modular reasoningabout object-based programs and facilitates their evolution.Actors extend the advantages of objects to concurrent com-putations by separating control (where and when) from thelogic of a computation.msgcreateFigure 1. Actors are concurrent objects which communicate throughmessages and may create new actors. An actor may be viewed as anobject augmented with its own control, a mailbox and a globally unique,immutable name.The Actor model of programming [1] allows programs tobe decomposed into self-contained, autonomous, interactive,asynchronously operating components. Due to their asyn-chronous operation, actors provide a model for the nonde-terminism inherent in distributed systems, reactive systems,mobile systems, and any form of interactive computing.B. History:The concept of actors has developed over three decades.The earliest use of the term actors was in Carl Hewitt’sPlanner [2] where the term referred to rule-based activeentities which search a knowledge base for patterns to match,and in response, trigger actions. For the next two decades,Hewitt’s group worked on actors as agents of computation,and it evolved as a model of concurrent computing. A briefhistory of actor research can be found in [3]. The commonlyused definition of actors today follows the work of Agha(1985) which defines actors using a simple operationalsemantics [1].DRAFTIn recent years, the Actor model has gained in popularitywith the growth of parallel and distributed computing plat-forms such as multi-core architectures, cloud computers andsensor networks. A number of actor languages and frame-works have been developed. Some early actor languagesinclude ABCL, POOL, ConcurrentSmalltalk, ACT++, CEif-fel (see [4] for a review of these) and HAL [5]. Actorlanguages and frameworks in current use include Erlang(from Ericsson) [6], E (Erights.org), Scala Actors library(EPFL) [7], Ptolemy (UC Berkeley) [8], ASP (INRIA) [9],JCoBox (University of Kaiserslautern) [10], SALSA (UIUCand RPI) [11], Charm++ [12] and ActorFoundry [13] (bothfrom UIUC), the Asynchronous Agents Library [14] andAxum [15] (both from Microsoft), and Orleans frameworkfor cloud computing from Microsoft Research [16]. Somewell-known open source applications built using actorsinclude Twitter’s message queuing system and Lift WebFramework, and among commercial applications are Face-book Chat system and Vendetta’s game engine.III. ILLUSTRATIVE ACTOR LANGUAGEIn order to show how actor programs work, considera simple imperative actor language ActorFoundry thatextends Java. A class defining an actor behavior ex-tends osl.manager.Actor. Messages are handled by meth-ods; such methods are annotated with @message. Thecreate(class, args) method creates an actor instance ofthe specified actor class, where args correspond to thearguments of a constructor in the class. Each newly createdactor has a unique name that is initially known only to thecreator at the point where the creation occurs.Listing 1 Hello World! program in ActorFoundry1 p u b l i c c l a s s H e l l o A c t o r e x t e n d s Acto r {23 @message4 p u b l i c v oid g r e e t ( ) t h r o w s R emo teC o deE xce pti on5 {6 ActorName o t h e r = n u l l ;7 send ( s t d o u t , ” p r i n t ” , ” Hello ” ) ;8 o t h e r = c r e a t e ( W orl dAc tor . c l a s s ) ;9 send ( o t h e r , ” a u d i e n c e ” ) ;10 }11 }1213 p u b l i c c l a s s Wor l dAc t or e x t e n d s A c t o r {1415 @message16 p u b l i c v o i d a u d i e n c e ( ) t h r o w s Re m ot e C o de E xc e p t io n17 {18 se n d ( s t d o u t , ” p r i n t ” , ” World ” ) ;19 }20 }A. Execution SemanticsThe semantics of ActorFoundry can be informally de-scribed as follows. Consider an ActorFoundry program Pthat consists of a set of actor definitions. An actor communi-cates with another actor in P by sending asynchronous (non-blocking) messages using the send statement: send(a,msg)has the effect of eventually appending the contents of msg tothe mailbox of the actor a. However, the call to send returnsimmediately


View Full Document

UCLA COMSCI 239 - karmani-agha

Download karmani-agha
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view karmani-agha and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view karmani-agha 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?