5 XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Messages specific to this example");
8 static int send(int argc, char *argv[])
11 MSG_task_put(MSG_task_create("Blah", 0.0, 0.0, NULL), MSG_host_self(), 0);
12 MSG_process_sleep(1.); /* FIXME: if the sender exits before the receiver calls get_sender(), bad thing happens */
17 static int receive(int argc, char *argv[])
21 MSG_task_get_with_timeout(&task, 0, DBL_MAX);
22 xbt_assert0(MSG_task_get_sender(task), "No sender received");
23 INFO1("Got a message sent by '%s'",
24 MSG_process_get_name(MSG_task_get_sender(task)));
29 int main(int argc, char *argv[])
31 MSG_error_t res = MSG_OK;
33 MSG_global_init(&argc, argv);
34 MSG_set_channel_number(100);
36 /* Application deployment */
37 MSG_function_register("send", &send);
38 MSG_function_register("receive", &receive);
40 MSG_create_environment(argv[1]);
41 MSG_launch_application(argv[1]);