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

Re: migration



Hi,

At a first glance, I would say that the exception means that you are
trying to migrate the runtime itself, and not a location. Looking at
your code, I'm not sure why this happens ... As I can't make
experiments today, I can't tell you why for sure, but here are a few
ideas:

- what happens if you don't put the method print in your code ?

- I'm not sure it's very clean to directly create threads ... usually
  threads correspond to some location (the one where they were
  create), but using Thread.create may not work here. So what happens
  when you use a let def f () = .... reply f () in f () instead of you
  code ?

I'll have a better look tomorrow.

Alan Schmitt

>Hi,
>
>
>here I am again, with a new question :-)
>
>I don't understand the behavior of these two little programs, each ran
>on a different machine:
>
>machine 1:
>
># Ns.user := "david";;      
>- : unit = ()
># Ns.register "destination" Join.here vartype;;
>Warning: VARTYPE replaced by type 
> Join.location metatype
>Using multicast
>Multicast aborted (Failure("setsock_join"))
>Querying name server shiva:20001
>- : unit = ()
># Join.server ();;
>- : unit = ()
>
>machine 2:
>
># Ns.user := "david";;      
>- : unit = ()
># let dest = Ns.lookup "destination" (vartype : Join.location
>metatype);;
>Warning: VARTYPE replaced by type 
> Join.location metatype
>Using multicast
>Multicast aborted (Failure("setsock_join"))
>Querying name server shiva:20001
>val dest : Join.location = <abstr>
># let log s = print_endline s; flush stdout;;
>val log : string -> unit = <fun>
># class p () =
>    method print =
>      let rec f () =
>        log "hello, world!";
>        Thread.delay 3.0;
>        f ()
>      in Thread.create f ()
>   
>    method migrate = Join.go
>  end;;
>class p (unit) =
>  method migrate : Join.location -> unit
>  method print : Thread.thread
>end
># let obj = new p ();;
>val obj : p = <obj>
># obj#print; Thread.delay 10.0; obj#migrate dest;;
>hello, world!
>hello, world!
>hello, world!
>hello, world!
>Uncaught exception: Failure("Go: migration of space location")
>
>
>What does this exception mean?
>
>dc
>
>-- 
>David Chemouil [mailto:chemouil@enseeiht.fr] [mobile: 06 84 16 26 65]
>
>Laboratoire d'informatique et de mathématiques appliquées (IRIT-INPT)


--
The hacker: someone who figured things out and made something cool happen.