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:54] – finished tvcutsemat:tutorial:actors [2007/04/01 12:05] – added tvcutsem
Line 35: Line 35:
  
 === Asynchronous Message Sending === === Asynchronous Message Sending ===
 +
 +AmbientTalk, like E, lexically distinguishes between synchronous method invocation and asynchronous message sending. The former is expressed as ''o.m()'' while the latter is expressed as ''o<-m()''. Regular object references can carry both kinds of invocations. Synchronous method invocation behaves as in any typical object-oriented language. When an asynchronous message is sent to a local object ("local" meaning "hosted by the same actor"), the message is enqueued in the actor's own message queue and the method invocation will be executed at a later point in time.
 +
 +Far references, like the reference stored in the variable ''a'' above, only carry asynchronous message sends, and as such totally decouple the objects in different actors in time: objects can //never// be blocked waiting for an outstanding remote procedure call, they can only communicate by means of purely //asynchronous// message passing. This is a key property of AmbientTalk's concurrency model, and it is a crucial property in the context of [[distribution|distributed programming]].
 +
 +Hence, given the example above, the method ''sayHello'' can only be invoked as follows given a far reference ''a'':
 +
 +<code>
 +>a<-sayHello();
 +>>nil
 +</code>
 +
 +async messages, parameter passing, futures
  
 === Isolates === === Isolates ===
 +
 +isolate stripe, by-copy, scoping rules, no external method defs
  
 === Actor Mirrors === === Actor Mirrors ===
 +
 +explain: mirror factory, message creation, message sending, install
 +
 +=== Nesting Actors ===
 +
 +lexical scoping rules for nested actors
at/tutorial/actors.txt · Last modified: 2020/02/05 21:26 by elisag