discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] GNU-Radio Companion Python flowgraph - return sig


From: Kevin Reid
Subject: Re: [Discuss-gnuradio] GNU-Radio Companion Python flowgraph - return signal that it is finished?
Date: Mon, 30 Sep 2019 08:43:52 -0700

On Mon, Sep 30, 2019 at 8:02 AM Andrew Payne <address@hidden> 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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]