[Date Prev][Date Next] [Chronological] [Thread] [Top]

distributed objects





Thanks for your answer.

In fact, this problem appeared as I was testing the migration of
distributed objects. Indeed, the doc says (sect 3.2.6) : "they can
migrate using the Join.go function with all automata, locations and
objects they contain". But what does "contain" mean? If it means that
the attributes of the object migrate with it, it is problematic, as a
program with object can be seen as a graph of objects, which implies
that each migration would migrate a big part of the graph. This is
confirmed by the following example, which shows no such migration
happens.

# class p () = 
    method p s = print_endline s; flush stdout 
  end;;
class p (unit) = method p : string -> unit end
# class m (p: p) =
    val p = p
    method m w = Join.go w
    method p_with_object s = p#p s
    method my_own_p s = print_endline s; flush stdout 
  end;;
# let  o = new m (new p ());;
val o : m = <obj>
# o#my_own_p "my own here";
  o#p_with_object "with object : here"; 
  o#m (Ns.lookup "dest" (vartype: Join.location metatype));
  o#my_own_p "my own there";
  o#p_with_object "with object : there";;
Warning: VARTYPE replaced by type 
 Join.location metatype
my own here
with object : here
Using multicast
Multicast aborted (Failure("setsock_join"))
Querying name server shiva:20001
with object : there     <--- no migration of the "contained" object
- : unit = ()

On the other machine, "my own there" is printed...


So the migration seems to only concern the object itself. I then thought
that the Join.goo would work:

# class p () = method p s = print_endline s; flush stdout end;;
class p (unit) = method p : string -> unit end
# class m (p : p) as self =
    val p = p
    method p s = p#p s
    method m w =
      Join.go w;     (* first migrate the current object... *)
      Join.goo (p :> < >)     (* ... then "contained" objects *)
  end;;
class m (p) =
  val p : p
  method m : Join.location -> unit
  method p : string -> unit
end
# let o = new m (new p ()) in
  o#p "here";
  o#m (Ns.lookup "dest" (vartype: Join.location metatype));
  o#p "there";;
Warning: VARTYPE replaced by type 
 Join.location metatype
here
Using multicast
Multicast aborted (Failure("setsock_join"))
Querying name server shiva:20001
there
- : unit = ()


But, as you can see, it doesn't work either :-)
Any suggestion ?

dc

-- 
David Chemouil [mailto:chemouil@enseeiht.fr] [mobile: 06 84 16 26 65]

Laboratoire d'informatique et de mathématiques appliquées (IRIT-INPT)