1 /******************** Non-deterministic message ordering *********************/
2 /* Server assumes a fixed order in the reception of messages from its clients */
3 /* which is incorrect because the message ordering is non-deterministic */
4 /******************************************************************************/
7 #include <mc/modelchecker.h>
10 XBT_LOG_NEW_DEFAULT_CATEGORY(example, "this example");
12 int server(int argc, char *argv[]);
13 int client(int argc, char *argv[]);
15 int server(int argc, char *argv[])
21 MSG_task_destroy(task);
24 MSG_task_receive(&task, "mymailbox");
27 MC_assert_stateful(atoi(MSG_task_get_name(task)) == 3);
33 int client(int argc, char *argv[])
37 MSG_task_create(argv[1], 0 /*comp cost */ , 10000 /*comm size */ ,
38 NULL /*arbitrary data */ );
40 MSG_task_send(task, "mymailbox");
46 int main(int argc, char *argv[])
49 MSG_global_init(&argc, argv);
51 MSG_create_environment("platform.xml");
53 MSG_function_register("server", server);
55 MSG_function_register("client", client);
57 MSG_launch_application("deploy_bugged1.xml");