examples/msg/process-migration/process-migration
examples/msg/process-startkilltime/process-startkilltime
examples/msg/process-suspend/process-suspend
-examples/msg/process-yield/process-yield
examples/msg/app-masterworker/app-masterworker
examples/msg/mc/bugged1
examples/msg/mc/bugged1_liveness
examples/s4u/actor-migration/s4u-actor-migration
examples/s4u/actor-priority/s4u-actor-priority
examples/s4u/actor-suspend/s4u-actor-suspend
+examples/s4u/actor-yield/s4u-actor-yield
examples/s4u/app-bittorrent/s4u-bittorrent
examples/s4u/app-masterworker/s4u-app-masterworker
examples/s4u/app-pingpong/s4u-app-pingpong
teshsuite/msg/listen_async/listen_async
teshsuite/msg/pid/pid
teshsuite/msg/process/process
+teshsuite/msg/process-yield/process-yield
teshsuite/msg/storage_client_server/storage_client_server
teshsuite/msg/task_destroy_cancel/task_destroy_cancel
teshsuite/msg/task_listen_from/task_listen_from
class yielder {
long number_of_yields;
public:
- explicit yielder() = default;
explicit yielder(std::vector<std::string> args)
-{
+{
number_of_yields = std::stod(args[1]);
}
void operator()()
{
- for (int i = 0; i < number_of_yields; i++)
- simgrid::s4u::this_actor::yield();
+ for (int i = 0; i < number_of_yields; i++)
+ simgrid::s4u::this_actor::yield();
XBT_INFO("I yielded %ld times. Goodbye now!", number_of_yields);
}
};
int main(int argc, char* argv[])
{
simgrid::s4u::Engine e(&argc, argv);
-
+
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
"\tExample: %s platform.xml deployment.xml\n",
argv[0], argv[0]);
-
+
e.loadPlatform(argv[1]); /* - Load the platform description */
e.registerFunction<yielder>("yielder");
- std::vector<std::string> args;
e.loadDeployment(argv[2]);