Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change the way the threads are launched: they are now launched as
[simgrid.git] / examples / master_slave_kill / Master.java
index f9d16a3..38c6ffb 100644 (file)
@@ -27,6 +27,7 @@ public class Master extends Process {
                try {
                        Msg.info("Create process on host 'alice'");
                    process2 = new Slave("alice","slave");
+                   process2.start();
                } catch (MsgException e){
                    System.out.println("Process2!");
                }
@@ -41,12 +42,8 @@ public class Master extends Process {
                                }
                }
                
-//             FinalizeTask task = new FinalizeTask();
-//             Msg.info("Send Mail2!");
-//             task.send("mail2");
-               
-               Process.waitFor(10);
-               Process.kill(process2);
-               
+               process2.kill();
+
+               Msg.info("Process2 is now killed, should exit now");
        }
 }