-// adsein: Is this really a daemon ? it ran only one task ? I just added a stupid loop
-int process_daemon(int argc, char *argv[])
-{
- msg_task_t task = NULL;
- XBT_INFO(" Start daemon on %s (%f)", MSG_host_get_name(MSG_host_self()), MSG_get_host_speed(MSG_host_self()));
- for(;;){
- task = MSG_task_create("deamon", MSG_get_host_speed(MSG_host_self()), 0, NULL);
- XBT_INFO(" Execute deamon");
- MSG_task_execute(task);
- MSG_task_destroy(task);
- }
- XBT_INFO(" Deamon done. See you!");
- return 0;
-}
-
-int process_sleep(int argc, char *argv[])
-{
- for(;;){
- XBT_INFO(" I'm alive but I should sleep");
- MSG_process_sleep(10);
- }
- XBT_INFO(" I'm done. See you!");
- return 0;
-}
-
-int commTX(int argc, char *argv[])
-{
- msg_task_t task = NULL;
- char mailbox[80];
- sprintf(mailbox, "comm");
- XBT_INFO(" Start TX");
- task = MSG_task_create("COMM", 0, 100000000, NULL);
- MSG_task_isend(task, mailbox);
- // We should wait a bit (if not the process will end before the communication, leading to an exception at the other side).
- MSG_process_sleep(30);
- XBT_INFO(" TX done");
- return 0;
-}
-
-int commRX(int argc, char *argv[])
-{
- msg_task_t task = NULL;
- char mailbox[80];
- sprintf(mailbox, "comm");
- XBT_INFO(" Start RX");
- msg_error_t error = MSG_task_receive(&(task), mailbox);
- if (error==MSG_OK) {
- XBT_INFO(" Receive message: %s", task->name);
- } else if (error==MSG_HOST_FAILURE) {
- XBT_INFO(" Receive message: HOST_FAILURE");
- } else if (error==MSG_TRANSFER_FAILURE) {
- XBT_INFO(" Receive message: TRANSFERT_FAILURE");
- } else {
- XBT_INFO(" Receive message: %d", error);
- }
- XBT_INFO(" RX Done");
- return 0;
-}
-
-/** Main function */