User Tools

Site Tools


at:tutorial:distribution

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
at:tutorial:distribution [2009/01/29 15:46]
elisag
at:tutorial:distribution [2009/01/29 22:10]
elisag *
Line 246: Line 246:
    
 <note tip> <note tip>
-[[distribution#dealing_with_permanent_failures|Leased object references]] make use of the ''takeOffline:'' primitive to terminate the access to a remote object once the lease time elapses. Note that the ''takeOffline'' primitive can be considered the equivalent to the so-called [[http://en.wikipedia.org/wiki/Manual_memory_management|''delete'' operation]] provided by some sequential languages without built-in local garbage collection.  Rather than using this primitive for garbage collection purposes, regular AmbientTalk developers are encouraged to make use of the high-level language constructs for leasing explained in the previous section which aids them to deal with both transient and permanent disconnections and properly reclaim their remote objects.+[[distribution#dealing_with_permanent_failures|Leased object references]] make use of the ''takeOffline:'' primitive to terminate the access to a remote object once the lease time elapses. Note that the ''takeOffline'' primitive can be considered the equivalent to the so-called [[http://en.wikipedia.org/wiki/Manual_memory_management|''delete'' operation]] provided by some sequential languages without built-in local garbage collection.  Rather than using this primitive for garbage collection purposes, regular AmbientTalk developers are encouraged to make use of the high-level language constructs for leasing explained [[distribution#dealing_with_permanent_failures|in the previous section]] which aids them to deal with both transient and permanent disconnections and properly reclaim their remote objects.
 </note> </note>
  
Line 272: Line 272:
 ====Distributed unit testing and takeOffline==== ====Distributed unit testing and takeOffline====
  
-As previously mentioned, the ''takeOffline'' primitive notifies connected virtual machines when taking an object offline. Since AmbientTalk 2.12, the primitive not only notifies remote virtual machines, but it also notifies the local virtual machine where the ''takeOffline'' was executed so that if any inner actor has local far references to that object, it will also get notified. In other words, if an object is taken offline, all actors holding far references to it (independent of their location) get notified. +As previously mentioned, the ''takeOffline'' primitive notifies connected virtual machines when taking an object offline. Since AmbientTalk 2.12, the primitive not only notifies remote virtual machines, but it also notifies the local virtual machine where the ''takeOffline'' was executed so that if any inner actor has local far references to that object, it will also get notified. In other words, if an object is taken offline, all actors holding (local or remote) far references to it get notified. 
  
-This semantics are useful for unit test purposes. The [[appendix#unit_testing_framework|unit testing framework]] shipped with AmbientTalk has support to perform asynchronous invocations which can be used to perform concurrent or distributed unit tests. However, distributed unit tests couldn'simulate network disconnections as ''network.offline'' works at actor level. In other words, ''network.offline'' simulates a disconnection of the complete virtual machine, but it cannot simulate the disconnection of a particular actor inside the VM. By means of ''takeOffline'' primitive, you can cut the access of an object contained in any actor (within the same VM or a remote VM),  enabling the simulation of the disconnection of an actor inside a virtual machine.+These semantics is useful for unit test purposes. The [[appendix#unit_testing_framework|unit testing framework]] shipped with AmbientTalk has support for asynchronous test invocations which can be used to perform concurrent or distributed unit tests. In fact, distributed unit tests are simulated by means of concurrency, i.e. using different actors in your unit test which make use of the network facilities. However, distributed unit tests cannot simulate network disconnections by means of ''network.offline'' since the construct works at virtual machine level. In other words, ''network.offline'' simulates a network disconnection of complete virtual machine, but what those tests need is to simulate the disconnection of a particular actor inside the virtual machine where they are running. 
 + 
 +By means of the ''takeOffline'' primitive, the intra-actor access to an object can be cut (independently if the actor is located within the same virtual machine or in a remote one),  enabling the simulation of the disconnection of an actor inside a virtual machine.
at/tutorial/distribution.txt · Last modified: 2009/01/30 16:13 by tvcutsem