Perrine Martignoni wrote:
[..]
>int DESTRUCT=0;
 
I'm always nervous to see global variables shared among threads without
a volatile keyword. An explicit memory barrier would be better, as it
has been re-explained in a LWN article lately (wait Thursday for free access)
http://lwn.net/Articles/233479/

But the problem in routine2 is somewhere else:

void routine2 (void * cookie){
        int ret; 
        struct sched_param param = {.sched_priority = 10 };
        pthread_setschedparam(pthread_self(), SCHED_FIFO, &param);
        for(;;){
                affich(2);
                ret = mq_send(mq2, buf2, MSG_SIZE, 0);
                printf("send mq2 returned %d, errno %s\n", ret, errno );
ouch!                                           ^^          ^^^^^
                ret = mq_receive(mq1, buf1, MSG_SIZE, NULL );
                printf("receive mq1 returned %d, errno %s\n", ret, errno); 
ouch!                                              ^^          ^^^^^
 

This should be either
                printf("receive mq1 returned %d, errno %d\n", ret, errno);
or
                printf("receive mq1 returned %d, errno %s\n", ret, 
strerror(errno));

-- 
Stephane

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to