Thanks. I did have a printf call in my "producer" function between the send and 
receive. 
Is this a bug?
Using two separate message queues does fix the problem, though I would expect 
that, as long as there is a mutex around the use in the "producer" function, 
one message queue should suffice.


-----Original Message-----
From: Gilles Chanteperdrix [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 01, 2006 11:40 PM
To: Landau, Bracha
Cc: [email protected]
Subject: RE: [Xenomai-help] mq_send /mq_receive problem


Landau, Bracha wrote:
 > The queue is opened with O_CREAT | O_RDWR.
 > Please note that I sent an updated version of the code that causes the crash 
 > - the queue in both the mq_send and mq_receive is "link_rq_mq".

Merging your sample with the code of the satch example, I arrived to the
attached test that work as expected as long as:
- the task priorities are correctly set
- there is no printf call between the mq_send and mq_receive in the
  "producer" function. It looks like such a printf suspends the
  GetLinkState thread out of mq_receive, so that when the LinkThread
  send a message, it is able to immediately receive it.

This state of affair is a bit fragile, in order to do something more
robust, you should probably use one message queue for each direction.

-- 


                                            Gilles Chanteperdrix.

*** NDS UK IT scanned this email for malicious content ***
*** IMPORTANT: Do not open attachments from unrecognized senders  ***
***********************************************************************************
This email message and any attachments thereto are intended only for use by the 
addressee(s) named above, and may contain legally privileged and/or 
confidential information. If the reader of this message is not the intended 
recipient, or the employee or agent responsible to deliver it to the intended 
recipient, you are hereby notified that any dissemination, distribution or 
copying of this communication is strictly prohibited. If you have received this 
communication in error, please immediately notify the [EMAIL PROTECTED] and 
destroy the original message.
***********************************************************************************

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

Reply via email to