How can you restart a flow graph after a head block kills it?
For example, I want to do something like the following:
tb.start()
tb.wait() # head block will terminate
… do some reconfiguration …
tb.start()
However, I get a seg fault if I ever try to call tb.start() after the
head
block returns.
I take it a flow graph isn’t reusable after a head block terminates?
If I remove the head block:
tb.start()
tb.stop()
tb.wait()
tb.start()
Works just fine. Could someone explain what is going on or point me to
the
documentation (having a hard to finding anything useful in the
documentation).
since segfaults are never desirable, we should look into the issue.
Generally, I’d say that flowgraphs are not really meant for restarting
if not special precautions were made. Many blocks are stateful,
meaning that it does matter if you’re the first sample to be processed
or the xth one; this is especially the case for the head block.
A flowgraph really just represents the connections between the blocks
the blocks are created prior to connecting and continue to exist
after the flowgraph stopped. So, unless starting a block anew resets
its state, there is no guarantee that things will work as in the first
call to start.
However, head should not crash; I will look into that tomorrow
morning. Could you please provide a minimal flowgraph example, and
your GR version as well as a little information on your platform (OS,
architecture)?