+int tasks_done = 0;
+
+static int process_daemon(int argc, char *argv[])
+{
+ XBT_INFO(" Start daemon on %s (%f)", MSG_host_get_name(MSG_host_self()), MSG_host_get_speed(MSG_host_self()));
+ for(;;){
+ msg_task_t task = MSG_task_create("daemon", MSG_host_get_speed(MSG_host_self()), 0, NULL);
+ XBT_INFO(" Execute daemon");
+ MSG_task_execute(task);
+ MSG_task_destroy(task);
+ tasks_done ++;
+ }
+ XBT_INFO(" daemon done. See you!");
+ return 0;
+}
+
+static 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;
+}
+
+static int commTX(int argc, char *argv[])
+{
+ const char * mailbox = "comm";
+ XBT_INFO(" Start TX");
+ msg_task_t 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, hence an exception on the other side).
+ MSG_process_sleep(30);
+ XBT_INFO(" TX done");
+ return 0;
+}
+
+static int commRX(int argc, char *argv[])
+{
+ msg_task_t task = NULL;
+ const char * 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: %u", error);
+ }
+ XBT_INFO(" RX Done");
+ return 0;
+}