discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] How do the Scheduler and the flowgraph work?


From: Tom Rondeau
Subject: Re: [Discuss-gnuradio] How do the Scheduler and the flowgraph work?
Date: Thu, 15 Jul 2010 22:57:03 -0400

On Thu, Jul 15, 2010 at 6:02 AM, Sammour <address@hidden> wrote:
>
> I have a basic question regarding GNURadio scheduler and how the flowgraph
> works. I am using gr_sync_block but my question are valid for gr_block
>
> From the online tutorial about how to write a block I read:
>
>  87    for (int i = 0; i < noutput_items; i++){
>  88      out[i] = in[i] * in[i];
>  89    }
>
> I could print noutput_items and it is a huge number in order of thousands.
> So my question is why should I create this loop? and how does it work? I
> have read somewhere in this discution board that not using this loop will
> increase the calclation overhead but no clue why. Does my block outputs the
> items "bunch by bunch" or item by item.
>
> Another question here: I saw few programs which dont return noutput_items
> from work or general_work so it seems that I dont have to always return it.
> How can I determine the value I shoud return.
>
> Cheers,
>
> Sam

The scheduler passes chunks of data items between processing blocks.
The noutput_items is the number of items the scheduler tells you that
you can produce. You want to produce as many items at one time as the
scheduler tells you that you can. The scheduler knows how to handle
this to maximize throughput.

When we write a block that doesn't return noutput_items, it's usually
due to some boundary condition; making sure that the items in the
input and output buffers keep some kind of alignment. This is where
things get complicated and you need to do a lot of analysis, thinking,
and work to figure it out.

Tom



reply via email to

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