[E-Lang] Re: Migration and Una (was: E FAQ)
Ken Kahn
kenkahn@toontalk.com
Sun, 30 Sep 2001 11:37:12 -0700
From: "Mark S Miller" <markm@caplet.com>
> Birds, Boxes, Robots, Trucks, and Nests. Oh my!
>
>
> >P.S. Object mobility is simple in ToonTalk. An object migrates by giving
a
> >bird a box with a copy of its robots and its box. The bird flies off to a
> >possibly remote host where a robot puts the incoming robots and box in a
> >truck and the object is now running on the host where the bird's nest is.
>
> I'm afraid I'm not yet good enough at translating between these worlds.
> Could you rephrase in more conventional language terminology? (Sorry)
>
An object (or actor) is a team of robots working on a box in a house. The
robots are the code and the box is the local state. When you give something
to a bird she takes it to her nest. So a bird is a sending end of a
communication channel and a nest is a receiving end. Loading a truck with a
team of robots and a box creates a new house with those robots working on
the box, i.e. it spawns a new object/actor.
So to migrate, one of the robots in a team needs to place the box (the
actor's local state) and a copy of the team he is a member of (the actor's
script) into a new box (in this case a two-element array). The robot gives
this new box to a bird whose nest is on the host where the actor is
migrating to. (To be tidy the robot should then blow up his house to
terminate and free any resources. Note that if instead of putting its box in
the new box, it made a copy then the actor would be replicated rather than
migrated.)
The box arrives on the nest on the destination host. A robot puts the
contents of the box into a truck and we now have an identical copy of the
robot team working in a new house on the original box (local state). Hence
it has migrated.
A caveat:
If the actor that is migrating provides a service then it will have at least
one nest in its box so it can receive requests. The current implementation
of birds delivering things to nests on other machines does not deal properly
with things that contain nests. I plan to fix this early next year.
I hope this makes it clear how objects can migrate in ToonTalk.
Best,
-ken kahn ( www.toontalk.com )