I'm still playing around with FIFOs. What I'm trying to get done is use fifos to synchronize a user space thread with a Reat Time thread.
A RT thread starts writing monotonically increasing on the fifo (3 bytes really) and the user space thread reads them. Easy, huh? Well, I was just wondering how full the fifo gets at all times, just to see if there is a delay between when the US should wake up and when it actually does. For the number of elements in the fifo, after following the long debate on these same channels, I'm using a ioctl on the US side and using a control fifo from the US to the RT side to have a aprox. idea on the RT side. I'm sure they aren't absolutely precise in all cases but should be close. At first the RT thread would start before the US one (just enough time to get the US moving). The FIFO would fill up at first and then the US thread would catch up. Clearly the rate at which the RT thread runs determines how fast and how well the whole thing would run. Running at 100Hz (I'm using a Pentium III 700MHz) it would catch up fairly fast and then basically never have delays again (there's only 1 or 0 elements in the FIFO at all times). Running at increasing frequencies it would get progressively worse. At 1KHz I get little cicles of 8 - 7 - 6- 5 - 4 - 3 - 2 - 1 - 0 - 8 packets in the fifo (that is 24 bytes to 0). After that I tried to synch the two threads from the beginning using a start-fifo (yet another one). The whole thing works better but in a way I did not expect. I expected the first delay to be smaller but then the steady state behavior to be the same. Truth is the delay starts at few elements in the fifo, then increases up to an amount X (ranging from 150 at 100Hz to 300 at 1KHz) and then decrease to 0 for whatever frequency I use. I can't really explain why: 1) it actually increases 2) it decreases to zero no matter the frequency, even though what has changed in the software is really the bootstrap part of the process... I'm doing this because ultimately I'd like to know how realiable it is to use fifos for synchronizing RT threads with US ones. I thought I'd find a frequency for the RT thread that would be optimal, probably a smallish one to give enough time to the US to read the fifo. But I'm not so sure anymore. thanks F ______________________________________________________________________ Do You Yahoo!? Il Nokia Game � on line! Clicca qui per iscriverti e partecipare alla nuova avventura multimediale entro il 3 novembre. Vai alla pagina del gioco http://it.promotions.yahoo.com/info/nokiagame.html! -- [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/
