Reg : start() method in gr_top_block.h

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.

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 ??


View this message in context:
http://gnuradio.4.n7.nabble.com/Reg-start-method-in-gr-top-block-h-tp37915.html
Sent from the GnuRadio mailing list archive at Nabble.com.

On 10/08/2012 04:12 PM, sumitstop wrote:

  • 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

Got it perfectly

**Just observed that in uhd_rx_cfile tb.run() has been used.
When we leave the number of samples blank i.e. infinity the script
keeps
collecting data because of tb.run() but when we choose the no of samples
option, a separate gr.head is block is created with specified no of
samples
and it stops after collecting the same.


View this message in context:
http://gnuradio.4.n7.nabble.com/Reg-start-method-in-gr-top-block-h-tp37915p37921.html
Sent from the GnuRadio mailing list archive at Nabble.com.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs