Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
process -> actor
[simgrid.git] / teshsuite / s4u / concurrent_rw / concurrent_rw.cpp
index c5e1fec..54aaf3a 100644 (file)
@@ -7,36 +7,38 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u test");
 
+namespace sg4 = simgrid::s4u;
+
 static void host()
 {
-  simgrid::s4u::Disk* disk = simgrid::s4u::this_actor::get_host()->get_disks().front(); // Disk1
-  aid_t id                 = simgrid::s4u::this_actor::get_pid();
-  XBT_INFO("process %ld is writing!", id);
+  const sg4::Disk* disk = sg4::this_actor::get_host()->get_disks().front(); // Disk1
+  aid_t id              = sg4::this_actor::get_pid();
+  XBT_INFO("actor %ld is writing!", id);
   disk->write(4000000);
-  XBT_INFO("process %ld goes to sleep for %ld seconds", id, id);
-  simgrid::s4u::this_actor::sleep_for(static_cast<double>(id));
-  XBT_INFO("process %ld is writing again!", id);
+  XBT_INFO("actor %ld goes to sleep for %ld seconds", id, id);
+  sg4::this_actor::sleep_for(static_cast<double>(id));
+  XBT_INFO("actor %ld is writing again!", id);
   disk->write(4000000);
-  XBT_INFO("process %ld goes to sleep for %ld seconds", id, 6 - id);
-  simgrid::s4u::this_actor::sleep_for(static_cast<double>(6 - id));
-  XBT_INFO("process %ld is reading!", id);
+  XBT_INFO("actor %ld goes to sleep for %ld seconds", id, 6 - id);
+  sg4::this_actor::sleep_for(static_cast<double>(6 - id));
+  XBT_INFO("actor %ld is reading!", id);
   disk->read(4000000);
-  XBT_INFO("process %ld goes to sleep for %ld seconds", id, id);
-  simgrid::s4u::this_actor::sleep_for(static_cast<double>(id));
-  XBT_INFO("process %ld is reading again!", id);
+  XBT_INFO("actor %ld goes to sleep for %ld seconds", id, id);
+  sg4::this_actor::sleep_for(static_cast<double>(id));
+  XBT_INFO("actor %ld is reading again!", id);
   disk->read(4000000);
 }
 
 int main(int argc, char** argv)
 {
-  simgrid::s4u::Engine e(&argc, argv);
+  sg4::Engine e(&argc, argv);
   e.load_platform(argv[1]);
 
   for (int i = 0; i < 5; i++)
-    simgrid::s4u::Actor::create("host", simgrid::s4u::Host::by_name("bob"), host);
+    sg4::Actor::create("host", sg4::Host::by_name("bob"), host);
 
   e.run();
-  XBT_INFO("Simulation time %g", simgrid::s4u::Engine::get_clock());
+  XBT_INFO("Simulation time %g", sg4::Engine::get_clock());
 
   return 0;
 }