Eric Blossom wrote:
> No.  In general it's virtually impossible to safely uses threads and
> signals together.  If you need a timer, one way to get it is to use a
> dedicated thread that manages the timer queue, then send messages to
> those who want them when the timer expires.
>
> [I'll be implementing something like this in the next few months]
>
> Eric
>
>   
Actually, it turned out to be remarkably easy.   With gr-generated code,
the main program is just:

        topblock.start()
        raw_input()
        topbloack.stop()

Which means that main runs in a separate thread.   So, I simply replaced
raw_input() with a loop that goes to
  sleep for 250msec, then checks the control file, then goes to sleep
again.   A bit in the control file asks the
  Python flowgraph to exit.  Simple.

Wish there was an easy way to merge grc-generated code with stuff like this.


-- 
Marcus Leech
Principal Investigator, Shirleys Bay Radio Astronomy Consortium
http://www.sbrac.org



_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to