[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rtl] long user writes to rtl fifos



Please note that POSIX Message Queues have been available in RTAI for
the last three months.
Could someone please point me towards the specification from which the
API call 'mq_recv' was taken so that I can update my understanding of
these beasts? 'mq_recv' does not feature in any POSIX spec. I've seen so
far, I use 'mq_receive'. Should it be 'mq_recv_np'? :-)

Best regards

Trevor Woolven.

yodaiken@fsmlabs.com wrote:
> 
> On Mon, Mar 13, 2000 at 10:28:30AM -0500, Paul Koning wrote:
> > I was looking at the rtl_fifo.c code and something struck me...  If
> > you write to /dev/rtf<n>, you can specify any length you like,
> > including one longer than the fifo buffer size.  Fine, the user
> > process stalls in mid-write until the real time thread makes more
> > room, then continues, repeating until the write count has been
> > satisfied.
> >
> > The question: it seems likely that a real time thread will be using
> > the rtf handler mechanism to trigger reading from the fifo.  Normally
> > that's not a problem, but in the case I mentioned the handler isn't
> > invoked until the write is done.  That's consistent... but it means
> > that you may have a deadlock.
> >
> > Even though it's slightly inconsistent, it seems appropriate for this
> > situation to call the handler when the user process is about to be
> > stalled due to lack of room.
> 
> Seems reasonable. Since user fifo writes are streams of bytes ...
> 
> I'd like to fold fifos into the POSIX mq. Fifos would still be files
> on the user side, but would be message queues on the RT side.
> Then if there is a structure, mq_recv on RT side will simply fail
> if a partial message structure is there.
> My idea is to extend so that mq_recv(md,&x,n*msize) can be used to read
> "n" messages. For standard fifos, message size is 1, and things will
> still work the same.
> 
> >
> >       paul
> > -- [rtl] ---
> > To unsubscribe:
> > echo "unsubscribe rtl" | mail majordomo@rtlinux.org OR
> > echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.org
> > ---
> > For more information on Real-Time Linux see:
> > http://www.rtlinux.org/~rtlinux/
> 
> --
> ---------------------------------------------------------
> Victor Yodaiken
> FSMLabs:  www.fsmlabs.com  www.rtlinux.com
> FSMLabs is a servicemark and a service of
> VJY Associates L.L.C, New Mexico.
> 
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail majordomo@rtlinux.org OR
> echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.org
> ---
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/~rtlinux/

-- 
Trevor Woolven - Director of Customer Applications Engineering
Zentropix Inc - a Lineo company

Tel: +44 (0)1273 234 647	 Fax: +44 (0)1273 704 482

Visit http://www.zentropix.com/ for Real Time Linux Tools
Visit http://www.realtimelinux.org/ for Real Time Linux Information