Thu, 04 Jan 2001 [EMAIL PROTECTED] wrote:
> Hello,
>
> I discovered something strange with the FIFOs (RTAI-1.5). I wrote a small
> RT task that basically put a character to a FIFO, do a few thing (print a
> message in the log file and do a few computation). and then read the FIFO
> again. This is the only RT task in the system. So normally, you expect every
> read to succeed. However, I observed a strangebehaviour. If when my task is
> running, I lauch a "cat </dev/rtf10" process on the shell prompt. The command
> gives me characters !!!!!!!!. So, this means that the rtf_put function stop
> the thread and do some rescheduling and so allow the linux process to read the
> character ... And the consequence is .... a simple Linux user space program is
> able to preempt a real time task which is not the expected behaviour in a
> realtime system.
Hmm... If you turn it around; eventually you'll end up with the user space task
sleeping, waiting for a character. In that situation, what does rtf_put() do?
Seems to me that the "correct" (*) behavior would be that the user space thread
is woken up, only to discover that the character is already gone. (The RT
thread was there first.)
What does the read() implementation in the FIFO module look like? Is it
possible that it does something nasty if woken up on an empty FIFO this way?
(*) The "nice" solution would be that the rtf_get() cancelled the wake up of the
user space thread instead of letting it wake up just to go back to sleep
again, but that just adds main path overhead to deal with a harmless
situation caused only by abuse of the FIFOs.
//David
..- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
`----------------------> http://www.linuxaudiodev.com/maia -'
..- David Olofson -------------------------------------------.
| Audio Hacker - Open Source Advocate - Singer - Songwriter |
`--------------------------------------> [EMAIL PROTECTED] -'
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/