/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
- simgrid::s4u::Storage* storage = simgrid::s4u::Storage::byName("Disk1");
- int id = simgrid::s4u::this_actor::getPid();
+ simgrid::s4u::Disk* disk = simgrid::s4u::this_actor::get_host()->get_disks().front(); // Disk1
+ int id = simgrid::s4u::this_actor::get_pid();
XBT_INFO("process %d goes to sleep for %d seconds", id, id);
simgrid::s4u::this_actor::sleep_for(id);
XBT_INFO("process %d is writing again!", id);
XBT_INFO("process %d goes to sleep for %d seconds", id, id);
simgrid::s4u::this_actor::sleep_for(id);
XBT_INFO("process %d is writing again!", id);
XBT_INFO("process %d goes to sleep for %d seconds", id, 6 - id);
simgrid::s4u::this_actor::sleep_for(6 - id);
XBT_INFO("process %d is reading!", id);
XBT_INFO("process %d goes to sleep for %d seconds", id, 6 - id);
simgrid::s4u::this_actor::sleep_for(6 - id);
XBT_INFO("process %d is reading!", id);
XBT_INFO("process %d goes to sleep for %d seconds", id, id);
simgrid::s4u::this_actor::sleep_for(id);
XBT_INFO("process %d is reading again!", id);
XBT_INFO("process %d goes to sleep for %d seconds", id, id);
simgrid::s4u::this_actor::sleep_for(id);
XBT_INFO("process %d is reading again!", id);
}
int main(int argc, char** argv)
{
simgrid::s4u::Engine e(&argc, argv);
}
int main(int argc, char** argv)
{
simgrid::s4u::Engine e(&argc, argv);
for (int i = 0; i < 5; i++)
simgrid::s4u::Actor::create("host", simgrid::s4u::Host::by_name("bob"), host);
e.run();
for (int i = 0; i < 5; i++)
simgrid::s4u::Actor::create("host", simgrid::s4u::Host::by_name("bob"), host);
e.run();