File source/sinks and named pipes

I have tried the following experiment that generated a couple of
puzzling questions for me…

A graph consisting of
a sinusodial source, a file sink and a graphical fft sink (connected
to the source).
NO THROTTLE is present in this graph

A separate graph with a file source, a THROTTLE at 100K
and a graphical fft sink

I creat a named pipe with
“mkfifo myfifo”
and both tx and rx are writting/reading to/from this pipe.

I run first the rx file and then (in a separate shell) the tx file.
Everything works as expected, ie both graphs seem to be working at the
same
rate. The reason (as I understand it) is the the rx file (containing
the throttle)
consumes data from the fifo at 100K and this INDIRECTLY sets the rate of
the tx
due to blocking of the tx when the fifo fills up (I read that Linux
has a 64K buffer for the fifo).
This is also evident from the system load which stays relatively low.

Q1: Is this the reason the two grahs are synchronized, or is it that
the throttle in the rx DIRECTLY sets the rate for the tx?

Now I do the following:
I stop the rx for roughly 10seconds and then I restart it.
During those 10 seconds the system load shoots to 100% which is to be
expected
since the tx does not have any throttle…
However I would ALSO expect that during those 10seconds the pipe
buffer fills up and
it blocks the tx, and so the tx eventually stops and waits for the rx
to be restarted and start consuming samples from the pipe, which is
somethig I do not observe!!!
Instead what I see is that the moment I restart the rx the load drops
somewhat for about 90seconds and then drops furthermore to the
original levels (observed when both rx and tx are running).

Q2: what happens to the tx and the named pipe when i stop the rx? and
why does in not fill and stop?

Thanks
Achilleas

On 10/08/2011 12:01 PM, [email protected] wrote:

and both tx and rx are writting/reading to/from this pipe.
Q1: Is this the reason the two grahs are synchronized, or is it that
the throttle in the rx DIRECTLY sets the rate for the tx?

Could you run your tx and rx in one graph without the throttle? This
way, we can find out whether the throttle plays its role.

Based on my understanding of the GNU Radio scheduler (see page 2 of this
paper: http://gnuradio.org/redmine/attachments/download/264), the
throttle will slow down the data rate at the rx chain, which then
back-pressures the buffers in the tx chain. If the throttle does work as
it is supposed to do, the above results are normal.

Instead what I see is that the moment I restart the rx the load drops
somewhat for about 90seconds and then drops furthermore to the
original levels (observed when both rx and tx are running).

Q2: what happens to the tx and the named pipe when i stop the rx? and
why does in not fill and stop?
Here is my search of the use of mkfifo:

“it has to be open at both ends simultaneously before you can proceed to
do any input or output operations on it.”

I suspect that once your stopped the rx chain, the fifo did not work at
all. Therefore, the data went directly from the source to the fft sink.
Once you restarted the rx, the fifo began to work. But it may take some
time to stabilize both tx and rx (because of the size of the fifo).
Again, the above paper could give you some hints.

Andrew