discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Reg : start() method in gr_top_block.h


From: Josh Blum
Subject: Re: [Discuss-gnuradio] Reg : start() method in gr_top_block.h
Date: Mon, 08 Oct 2012 16:22:47 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0


On 10/08/2012 04:12 PM, sumitstop wrote:
> Q-1
> 
> In the gr_top_block.h the start function has been defined as follows :
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> void start(int max_noutput_items=100000);
> 
>   /*!
>    * Stop the running flowgraph.  Notifies each thread created by the
>    * scheduler to shutdown, then returns to caller. Calling stop() on
>    * a top_block that is already stopped IS NOT an error.
>    */
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> I am getting confused because its saying that it "Stop the running flow
> graph ........... Notifies each thread created by the scheduler to shutdown
> ................ then returns to caller" So what does start means here. 
> 

start() -> spawns threads, begins flow graph execution
stop() -> non blocking, interrupts threads, see boost thread interrupts
wait() -> blocking join of threads, ie waits for completion

run is a convenience call for finite flowgraph processing. run() means
start() + wait(). There is no stop because the flowgraph should shut
itself down by use of blocks like gr.head(). Essentially, this is for
testing purposes almost exclusively.

> Q-2
> 
> Also its mentioned that run() method has maximum number of outputs is
> 1000000 but I was able to collect 2000000 samples using uhd_rx_cfile with
> the tb.run() method ? Where I am wrong ?? 
> 

start/run with the number of items parameter are just convenience calls
to set the max buffer size + start/run the flow graph.

Thats an internal buffer size limit. It shouldn't effect the functional
correctness of a flowgraph.

-josh



reply via email to

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