"John P. Hartmann" wrote:
> The problem is the FANOUT.  You only terminated one of its outputs.

Nope, he never terminated either of them.

The reason for the stall is that you're trying to get GATE to read a
record on the primary input while it's still busy writing that same
record to its alternate output.  In a feedback loop, you always need
another stage to buffer the record so the write can finish, and that's
what ELASTIC did for you.

You must have put the ELASTIC before the TAKE.  Even though STRICT makes
GATE check for available records on the primary input, ELASTIC won't
make a record available until GATE actually tries to read one.  Your one
record is trapped forever in ELASTIC because nobody ever asks to see it.

If you put ELASTIC (or even BUFFER) after TAKE instead, TAKE will sever
its output as soon as it writes the record, and then ELASTIC or BUFFER
will start writing its output right away.  Generally, though, what you
want to use in a feedback loop is COPY, which buffers each record one at
a time.  

In this case, you can eliminate the feedback loop entirely.  Just move
stream 1 of GATE *after* the primary of FANOUT.  That way, the record
arrives at input 0 of GATE after input and output 1 have been released
but before another record can arrive on input 1.  Since you know records
will never be available on both inputs simultaneously, you don't need
STRICT.  And you can leave out the TAKE, since GATE will terminate as
soon as the first record arrives.

  'PIPE (end ?)', 
     '?i:  faninany', 
     '|    locate \'termstring'\', 
     '|g:  gate', 
     '?    starmsg', 
     '|o:  fanout ', 
     '|g:', 
     '|    specs 17-* 1', 
     '|    console', 
     '?o: |i:' 

¬R  "I love Blip just because it's the absolute opposite of fun"
http://users.bestweb.net/~notr/travelog/19990710.html     --Kibo

Reply via email to