[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: [rtl] FIFO writes & reads atomic?
Thanks for the info Michael.
Since writes from a Linux process are not atomic, then does it follow
that the rtl task which reads from that fifo must deal with possible
short writes from the linux process?
For example, if I have a command structure that I'm sending from a
Linux process into a fifo. Then the rt task which is to receive that
command structure must know the length of that structure and deal
with the possibility that it might have to accumulate further bytes
from that fifo without blocking before that command structure can
be used.
Have I got it straight? If so, then I was thinking that there are
two possible solutions to this situation. Have the command structure
be of fixed length, or, have the first byte of the command structure
indicate the length of that structure.
In either of these two situations, the rt fifo handler can then accumulate
all the bytes received in multiple invocations without blocking. If the
command is 100 bytes, and it receives 60, then it knows it must keep these
60 around in a local buffer until, in a later invocation, it gets the
remaining 40.
Am I stating the obvious? Is there a simpler way? If the rt task is
quite active, then the command structure being passed could be quite
chopped up. I.e. there could be many invocations of the rt fifo handler.
Regards,
Jim.
At 11:31 AM 6/15/98 +0400, Michael Barabanov wrote:
>James Cassidy (jcassidy@nova.genesoft.com) wrote:
>> Can I assume that writes from a rt task into a fifo are
>> atomic from the point of view of the linux task reading the fifo?
>
>In the standard version of RT-Linux reads and writes from RT-tasks are
atomic.
>If there's no space in the buffer for rtf_put, it will fail. Similarly for
>rtf_get. Reads and writes from Linux processes are not atomic. The code
is in
>fs/rt_fifo_new.c.
>
>Michael.
>--- [rtl] ---
>For more information on Real-Time Linux see:
>http://www.rtlinux.org/
>
>
--- [rtl] ---
For more information on Real-Time Linux see:
http://www.rtlinux.org/