From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <50AA3732.5000701@xenomai.org> Date: Mon, 19 Nov 2012 14:42:10 +0100 From: Gilles Chanteperdrix MIME-Version: 1.0 References: <4FF369E5.5040007@xenomai.org> <4FF402AD.3020601@xenomai.org> <4FF415AB.2030503@xenomai.org> <4FF44389.3030209@xenomai.org> <4FF44C52.6050809@xenomai.org> <4FF585C4.1000708@xenomai.org> In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Subject: Re: [Xenomai] Xenomai and normal linux application - Wait time with select() not reliable List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?SmVucyBLw7ZobGVy?= Cc: xenomai@xenomai.org On 11/19/2012 02:29 PM, Jens Köhler wrote: > Hello, > > Now is Xenomai 2.6 installed. But I have sometimes still delays in > user space applications. > > Delay: 0.003064 > Delay: 0.003066 > Delay: 0.003504 > Delay: 0.003066 > Delay: 0.003066 > Delay: 0.003066 > Delay: 0.003090 > Delay: 0.003064 > Delay: 0.003066 > Delay: 0.003067 > Delay: 0.053807 <- 53 ms instead 3ms > Delay: 0.003067 > Delay: 0.003067 > > I found out that problem depends from a real time queue between two > Xenomai tasks. > > retval = rt_queue_create(&RtMeasureData, "RtMeasureData", 1000 * 256, > Q_UNLIMITED, Q_FIFO | Q_SHARED); > > A real time task writes measurement data every 2 ms to a rt_queue. > retval = rt_queue_write(&RtMeasureData, &FifoMeasureData, 256, Q_NORMAL); > > Another Xenomai task reads all measured data from queue and makes them > available for user land applications. (Task is not real time, context > switches) > > retval = rt_queue_read(&RtMeasureData, &FifoMeasureData, 256, TM_NONBLOCK); > > When nothing is written to queue is there also never an unexpected delay. > > Any ideas or recommendations to find reason for problem? Without seeing any code, there is strictly nothing we can do. If you are able to reduce the code to a simple, self-contained test case we can run anywhere, then we can have a look at it. If not, then use the I-pipe tracer. -- Gilles.