On Mon, Nov 03, 2014 at 09:01:32PM +0100, Philippe Gerum wrote:
> On 11/03/2014 07:37 PM, Steve M. Robbins wrote:
> > On Mon, Nov 03, 2014 at 05:29:53PM +0100, Philippe Gerum wrote:
> > 
> >> Just to make sure we are on the same page, as Dietmar mentioned in an
> >> earlier mail, read() as implemented by the rt-pipe driver only returns
> >> _one_ message at a time, although > 1 could be pending. One has to
> >> iterate over a read() loop using a non-blocking fd on the /dev/rtp
> >> device to get them all.
> > 
> > Aha!  Thanks (and to Dietmar).  I completely missed this fact.  I'll
> > go re-write the read as a loop and see if it works better.  I should read
> > until the read() returns 0 (bytes read)?
> > 
> 
> Until you get -1 with errno == EWOULDBLOCK. Zero would rather mean that
> the other end of pipe has been disconnected, just like with a regular FIFO.

Yes, that seems to work.  The loop is reading about 2 messages on
average as expected and no more filling up the heap.

Thanks!
-Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 173 bytes
Desc: Digital signature
URL: 
<http://www.xenomai.org/pipermail/xenomai/attachments/20141103/1e452982/attachment.sig>
_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai

Reply via email to