On Wed, Dec 31, 2008 at 12:32:45PM -0800, Earle Frank wrote: > Starting back at the problem description...
> Okay I am using the default scheduler. So now I have enabled the logging for > the appropriate thread-per-block scheduler files. > > Here's the heart of my problem. My flow graph has five blocks, A, B, C, D, > E. > Output of A is input to B and C. > Output of C is input to D. > Output of B and D are input to E. > > Block A is a file source. > > Block B has a 1-to-1 input to output function. > > Block C breaks the samples from A into partitions of N samples. The block > does its function over the N samples. Then it outputs the resulting N > values. > > Block D looks at the input and produces an enable signal. The curious > feature, due to implementation, is that this block will only output the > enable signal high once it detects the enable going back low. > > Block E takes the inputs from B and D and only outputs the values of B when > D (the enable) is high. > > Running this flow graph hangs. Looking at the log files produced for each > block I see that blocks A & B are BLKD_OUT and blocks C, D & E are BLKD_IN. > > In this scenario, an enable signal will exist over a partition boundary, say > starts at N-10 and ends at N+10. > > At the point of hanging: Let's say that block D never produces an output, but is consuming all of it's input. Can you see how this leads to a hang? It goes like this. E ends up BLKD_IN on it's second input, but meanwhile the buffer on it's first input is full. It's full because B has been writing it as quickly as it can. Once E's first input buffer (== B's output buffer) is full. B becomes output blocked. It will never run again because it's got nowhere to put it's output. B and C both read from A's output 0 output buffer (it's single-writer, dual-reader buffer (A writes, B & C read)). C could still run (it it had input), since D's draining its output. A's buffer does fill up however, because B is no longer able to run, and thus A's buffer does not empty. The fact that C is reading is necessary but not sufficent to drain A. Both B and C need to be consuming A's output, but B is output blocked. Does this make sense? This is where my comment about needing an unbounded amount of memory in the worst case comes from. In your case, the question is how long can D go without producing an output before the hang occurs? Given long enough, it will hang. The answer is based on the size of the buffers between the blocks. Although not specified and not part of any advertised contract, subject to change on a whim, ... the buffers are typically about 32KB... Eric _______________________________________________ Discuss-gnuradio mailing list [email protected] http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
