On Mon, Sep 30, 2019 at 8:02 AM Andrew Payne <wandr...@gmail.com> wrote:

> I always do a tb.stop() followed by a tb.wait(), because I assume that
> .stop() is not blocking but .wait() is blocking


Yes, this is correct.

If you call stop() then wait() you stop the flow graph and wait for the
threads to actually shut down after they are commanded to. If you call
wait() then stop() then you also wait for the flow graph to finish its work
rather than stopping it early.

and this is the best practice way to prematurely stop a flowgraph.  Or is
> the .wait() necessary?


You must call wait() if you want to call start() again, or if you want to
wait for the threads to actually stop (which blocks *may* react to by
releasing resources or other cleanup actions).

In my programming I make a habit of always calling stop() and wait()
together, in whichever order suits the application.
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to