From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4A5DF5EB.8040509@domain.hid> Date: Wed, 15 Jul 2009 17:29:47 +0200 From: Gilles Chanteperdrix MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-help] mq_send takes longer than expected List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Steve Cc: xenomai@xenomai.org Steve wrote: > Hi, > > Calling mq_send takes significantly varied amounts of time depending > on the queue length. I was not expecting this behaviour, particularly > as this does not happen when using RTAI mq_send calls. I can > understand that queue creation / opening times will heavily depend on > the queue's overall size, however I would have thought that sending a > message (adding it to the queue's data structure (linked list?)) would > take a constant time. > > Is this a bug, or expected behaviour? I have attached an example. mq_send is expected by the posix specification to block its caller when the queue is full. If you do not want this behaviour, you should pass O_NONBLOCK to mq_open and be prepared for mq_send to return -1 with errno set to EAGAIN/EWOULDBLOCK. Would this be your problem ? -- Gilles