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[]) {
20 MSG_task_destroy(task);
23 MSG_task_receive(&task,"mymailbox");
26 MC_assert(atoi(MSG_task_get_name(task)) == 3);
32 int client(int argc,char *argv[]) {
34 m_task_t task = MSG_task_create(argv[1], 0/*comp cost*/, 10000/*comm size*/, NULL /*arbitrary data*/);
36 MSG_task_send(task,"mymailbox");
42 int main(int argc,char*argv[]) {
44 MSG_global_init(&argc,argv);
46 MSG_create_environment("platform.xml");
48 MSG_function_register("server", server);
50 MSG_function_register("client", client);
52 MSG_launch_application("deploy_bugged1.xml");