Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
s4u: test what happens when we kill a newborn actor (seems to work)
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 3 Apr 2018 11:45:39 +0000 (13:45 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 3 Apr 2018 11:45:39 +0000 (13:45 +0200)
examples/s4u/actor-kill/s4u-actor-kill.cpp
examples/s4u/actor-kill/s4u-actor-kill.tesh

index 3663640..51c90b6 100644 (file)
@@ -52,6 +52,13 @@ static void killer()
 
   simgrid::s4u::this_actor::sleep_for(1);
 
 
   simgrid::s4u::this_actor::sleep_for(1);
 
+  XBT_INFO("Start a new actor, and kill it right away");
+  simgrid::s4u::ActorPtr victimC =
+      simgrid::s4u::Actor::createActor("victim C", simgrid::s4u::Host::by_name("Jupiter"), victimA_fun);
+  victimC->kill();
+
+  simgrid::s4u::this_actor::sleep_for(1);
+
   XBT_INFO("Killing everybody but myself");
   simgrid::s4u::Actor::killAll();
 
   XBT_INFO("Killing everybody but myself");
   simgrid::s4u::Actor::killAll();
 
@@ -72,7 +79,5 @@ int main(int argc, char* argv[])
 
   e.run(); /* - Run the simulation */
 
 
   e.run(); /* - Run the simulation */
 
-  XBT_INFO("Simulation time %g", e.getClock());
-
   return 0;
 }
   return 0;
 }
index eca4cd3..ba2afdc 100644 (file)
@@ -10,6 +10,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-kill ${platfdir}/small_platform.xml "--l
 > [ 12.000000] (killer@Tremblay) Kill the victim A
 > [ 12.000000] (victim A@Fafard) I have been killed!
 > [ 13.000000] (killer@Tremblay) Kill victimB, even if it's already dead
 > [ 12.000000] (killer@Tremblay) Kill the victim A
 > [ 12.000000] (victim A@Fafard) I have been killed!
 > [ 13.000000] (killer@Tremblay) Kill victimB, even if it's already dead
-> [ 14.000000] (killer@Tremblay) Killing everybody but myself
-> [ 14.000000] (killer@Tremblay) OK, goodbye now. I commit a suicide.
-> [ 14.000000] (maestro@) Simulation time 14
+> [ 14.000000] (killer@Tremblay) Start a new actor, and kill it right away
+> [ 14.000000] (victim C@Jupiter) I have been killed!
+> [ 15.000000] (killer@Tremblay) Killing everybody but myself
+> [ 15.000000] (killer@Tremblay) OK, goodbye now. I commit a suicide.