Skip to content Skip to sidebar Skip to footer

Plot Freezing Because Of Fast Input Stream To A Gnu Radio Block

I have implemented a sync block which plots inside its work function using the input_items values. Now the problem is that the plotting mechanism isn't fast enough for the input st

Solution 1:

To cite another answer I gave:

This will quickly also get a multithreading problem. To be clear: What you're trying to do (call a plotting function from a block thread) is problematic and usually won't work.

The problem is that you're working in a complex multithreading environment:

  • each GNU Radio block works in its own thread
  • The WX Gui main loop runs continously to update the screen.

What you're doing here is, from a GNU Radio block thread, change what is shown in the window. That is a bad thing, because it changes things that are in the context of the WX Gui thread. This can work, if these changes don't conflict, and if the WX Gui thread doesn't access this kind of data while you're changing it (at some point, it has to access it -- otherwise, noone will update your window).

This is a problem common to all kind of updated GUIs, not only to GNU Radio!

Whether or not that happens is a mere case of probability: With a slowly updated display, your probability of conflict is low, but when you update often, it approaches 1.

The existing visualizations are written in C++ and take very great care to do things the right way -- which is, letting your Gui toolkit (WX in your case, though I explicitely recommend, and have recommended, to move away from that) know that things need to be updated, and then offering WX a function to update the display in its own thread.

Post a Comment for "Plot Freezing Because Of Fast Input Stream To A Gnu Radio Block"