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

Final_tag



Hello,

I have some problems by moving location from a runtime to another.
I have tree locations :
-two locations in background (which are just host for my third location)

-one migrant location.
The migrant location just print "." in loop by calling the asynchronous
channel 'print' spawned in the location. we also can migrate the
location by calling the synchronous channel go.
I have two tests :
-one with a recursive call to the channel print which works well.
-one with a recursive function called in the channel
and the runtime give me :

Final tag
OK, a channel ...
Size 2

I give you my code. I hope you can explain me what happens



--
Châtelet Guillaume
Stagiaire FT R&D, DTL/MSV/MFL
du 02/04 au 31/08/2001
sous la responsabilité de Pierre Crégut


(*  tache de fond *)
let 
    loc location
    def 
    loop! () = { 
      Thread.delay 10.0 ;
      loop () 
    }
    do { loop () }




let start () =
  let 
    loc migrant 
    def 
      print! () = {
        print_string "." ;  
       	print() 
      }  
      and 
      go (location) = {
        Join.go location ;
        reply 
      } 
    do {
      print() 
    } 
  in
  go
  


let _ =
  let location_2 = Ns.lookup "location2" (vartype : Join.location metatype) in
  let go = start() in  

  Thread.delay 0.5 ;
  go (location_2) ;
  print_string "ok\n" ;
  flush stdout 

(*  tache de fond *)
let 
    loc location
    def 
    loop! () = { 
      Thread.delay 10.0 ;
      loop () 
    }
    do { loop () }


let start () =
  let 
    loc migrant 
    def 
      print! () = {
         let rec loop () =
	   print_string "/" ; 
	   loop ()
	 in
	 loop () ; {}
      }  
      and 
      go (location) = {
        Join.go location ;
        reply 
      } 
    do {
      print() 
    } 
  in
  go



let _ =
  let location_2 = Ns.lookup "location2" (vartype : Join.location metatype) in
  let go = start() in

  Thread.delay 0.5 ;
  go (location_2) ;
  print_string "ok\n" ;
  flush stdout 

let 
    loc location_2
    def 
    loop! () = { 
      Thread.delay 10.0 ;
      loop () 
    }
    do { loop () }


let _ =
  Ns.register "location2" location_2 vartype