/* 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. */
{
double task_comp_size = 5E7;
double task_comm_size = 1E6;
double timeout = 1;
msg_task_t task = MSG_task_create("normal", task_comp_size, task_comm_size, NULL);
{
double task_comp_size = 5E7;
double task_comm_size = 1E6;
double timeout = 1;
msg_task_t task = MSG_task_create("normal", task_comp_size, task_comm_size, NULL);
MSG_task_send_with_timeout(task, "worker_mailbox", timeout);
task = MSG_task_create("cancel directly", task_comp_size, task_comm_size, NULL);
MSG_task_send_with_timeout(task, "worker_mailbox", timeout);
task = MSG_task_create("cancel directly", task_comp_size, task_comm_size, NULL);
MSG_task_cancel(task);
MSG_task_destroy(task);
task = MSG_task_create("destroy directly", task_comp_size, task_comm_size, NULL);
MSG_task_cancel(task);
MSG_task_destroy(task);
task = MSG_task_create("destroy directly", task_comp_size, task_comm_size, NULL);
MSG_task_destroy(task);
task = MSG_task_create("cancel", task_comp_size, task_comm_size, NULL);
msg_comm_t comm = MSG_task_isend(task, "worker_mailbox");
MSG_task_destroy(task);
task = MSG_task_create("cancel", task_comp_size, task_comm_size, NULL);
msg_comm_t comm = MSG_task_isend(task, "worker_mailbox");
MSG_task_destroy(task);
task = MSG_task_create("finalize", task_comp_size, task_comm_size, NULL);
comm = MSG_task_isend(task, "worker_mailbox");
MSG_task_destroy(task);
task = MSG_task_create("finalize", task_comp_size, task_comm_size, NULL);
comm = MSG_task_isend(task, "worker_mailbox");
task = MSG_task_create("cancel", task_comp_size, task_comm_size, NULL);
MSG_task_send_with_timeout(task, "worker_mailbox", timeout);
task = MSG_task_create("cancel", task_comp_size, task_comm_size, NULL);
MSG_task_send_with_timeout(task, "worker_mailbox", timeout);
res = MSG_task_execute(task);
XBT_INFO("Task %s", res == MSG_OK ? "done" : "failed");
MSG_task_destroy(task);
return 0;
}
res = MSG_task_execute(task);
XBT_INFO("Task %s", res == MSG_OK ? "done" : "failed");
MSG_task_destroy(task);
return 0;
}
XBT_INFO("Handling task \"%s\"", MSG_task_get_name(task));
if (not strcmp(MSG_task_get_name(task), "finalize")) {
XBT_INFO("Handling task \"%s\"", MSG_task_get_name(task));
if (not strcmp(MSG_task_get_name(task), "finalize")) {
if (not strcmp(MSG_task_get_name(task), "cancel")) {
MSG_process_create("worker1", worker_main, task, MSG_host_self());
MSG_process_sleep(0.1);
if (not strcmp(MSG_task_get_name(task), "cancel")) {
MSG_process_create("worker1", worker_main, task, MSG_host_self());
MSG_process_sleep(0.1);