5 XBT_LOG_NEW_DEFAULT_CATEGORY(test,"Messages specific to this example");
8 static int send(int argc, char *argv[]){
10 MSG_task_put(MSG_task_create("Blah", 0.0, 0.0, NULL),
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[]) {
20 MSG_task_get_with_timeout(&task, 0, DBL_MAX);
21 xbt_assert0(MSG_task_get_sender(task), "No sender received");
22 INFO1("Got a message sent by '%s'", MSG_process_get_name(MSG_task_get_sender(task)));
27 int main(int argc, char *argv[]) {
28 MSG_error_t res = MSG_OK;
30 MSG_global_init(&argc,argv);
31 MSG_set_channel_number(100);
33 /* Application deployment */
34 MSG_function_register("send", &send);
35 MSG_function_register("receive", &receive);
37 MSG_create_environment(argv[1]);
38 MSG_launch_application(argv[1]);
41 if(res==MSG_OK) return 0;