User Tools

Site Tools


at:tutorial:actors

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
at:tutorial:actors [2007/04/01 11:32] – added tvcutsemat:tutorial:actors [2007/04/01 11:46] – added tvcutsem
Line 16: Line 16:
  
 === Actors and Far References === === Actors and Far References ===
 +
 +In AmbientTalk, concurrency is spawned by creating actors: each actor is an autonomous processor. AmbientTalk's actors are based on the [[Wp>E_programming_language|vat model]] of the [[http://www.erights.org|E programming language]]. In AmbientTalk, an actor consists of a message queue (to store incoming messages), a thread of control (to execute the incoming messages) and a number of regular objects that are said to be //hosted// by the actor.
 +
 +When an actor is created, it hosts a single object which is said to be the actor's //behaviour//: it is the "public interface" to the actor. The object that created the new actor gets a reference to this behaviour object, such that it can start sending messages to the new actor. An actor can be created in AmbientTalk as follows:
 +
 +<code>
 +def a := actor: {
 +  def sayHello() {
 +    system.println("Hello World")
 +  };
 +};
 +</code>
  
 === Asynchronous Message Sending === === Asynchronous Message Sending ===
at/tutorial/actors.txt · Last modified: 2020/02/05 21:26 by elisag