discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Wait for another thread to finish in the top bloc


From: Tom Rondeau
Subject: Re: [Discuss-gnuradio] Wait for another thread to finish in the top block?
Date: Tue, 3 Jul 2012 17:14:06 -0400

On Thu, Jun 21, 2012 at 11:00 PM, Dekst <address@hidden> wrote:
> Hi, All,
>
> For OFDM demodulation, in gnuradio/gr-digital/python/ofdm.py,  a
> _queue_watcher_thread is defined. It returns whether a packet is received
> correctly, what's the sequence number, and so on.
> I'm using gnuradio/gr-digital/examples/ofdm/benchmark_rx.py to decode
> samples saved by uhd/host/rx_samples_to_file.
> Thoses samples are processed by C++ modules and organized into packets
> enqueued in rcvd_pktq, waiting for _queue_watcher_thread to retreive them.
> I found that sometimes the benchmark_rx.py terminates before the rcvd_pktq
> is empty, that is, the _queue_watcher_thread hasn't finished all packets in
> the rcvd_pktq but the main program is terminated. Maybe all samples in the
> file have been processed by C++ modules and thus the main program
> terminates.
> How can I make the main program wait for the _queue_watcher_thread??? Make
> sure all packets in the queue are processed.
>
> Thanks a lot!
>
> Pei


You normally "join" a thread to wait for it to end. You might be able
to explicitly call a join on the watcher thread that would allow it to
continue. The problem there is that you now need to figure out a way
to tell that thread that it is done processing.

Tom



reply via email to

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