# QUESTION: Number of inputs to general\_work

**URL:** <https://www.ruby-forum.com/t/question-number-of-inputs-to-general-work/125160>\
**Category:** GNU Radio\
**Created:** [January 6, 2008, 12:18pm UTC](https://www.ruby-forum.com/t/question-number-of-inputs-to-general-work/125160 "2008-01-06T12:18:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonas\_Gacrama](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9e8a1a/32.png) [@Jonas\_Gacrama](https://www.ruby-forum.com/u/Jonas_Gacrama)\
**Post date:** [January 6, 2008, 12:18pm UTC](https://www.ruby-forum.com/t/question-number-of-inputs-to-general-work/125160/1 "2008-01-06T12:18:20Z")

</div>

I have a question regarding the argument &input\_items in the function  
general\_work from the library gr\_block.h. Is my understanding correct  
that  
it only takes ONE STREAM of inputs at a time?

I was hoping to implement a TWO CHANNEL input (two different sources and  
not  
the in-phase and quadrature type of inputs). And to do this I need TWO  
INPUT  
STREAMS.

Is it possible to do this in GNU Radio? If so, how?

Thanks!

---

<div class="post-metadata">

**Author:** ![Jonas\_Gacrama](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9e8a1a/32.png) [@Jonas\_Gacrama](https://www.ruby-forum.com/u/Jonas_Gacrama)\
**Post date:** [January 6, 2008, 11:42pm UTC](https://www.ruby-forum.com/t/question-number-of-inputs-to-general-work/125160/2 "2008-01-06T23:42:33Z")

</div>

Read the ‘how to write a block’ document:  
[http://www.gnu.org/software/gnuradio/doc/howto-write-a-block.html](http://www.gnu.org/software/gnuradio/doc/howto-write-a-block.html)

It clearly explains that you can have an infinite number of input  
streams and how to achieve it.

- George

---

<div class="post-metadata">

**Author:** ![Jonas\_Gacrama](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9e8a1a/32.png) [@Jonas\_Gacrama](https://www.ruby-forum.com/u/Jonas_Gacrama)\
**Post date:** [January 7, 2008, 3:30am UTC](https://www.ruby-forum.com/t/question-number-of-inputs-to-general-work/125160/3 "2008-01-07T03:30:31Z")

</div>

These are some of the input parameters of gr\_block::general\_work() :

input\_items vector of pointers to the input items, one entry per input  
stream  
output\_items vector of pointers to the output items, one entry per  
output stream

Am I correct in understanding that the input\_items CAN point to a  
vector type of inputs? I plan to implement two input channels  
of vector type. Therefore I plan to pass TWO POINTERS of  
vector type as “input\_items” to general\_work.

Note that the discussion on this website:  
“[http://www.gnu.org/software/gnuradio/doc/howto-write-a-block.html](http://www.gnu.org/software/gnuradio/doc/howto-write-a-block.html)”  
only used one  
“channel” of inputs since it only took values from a single stream. I  
plan to take TWO CHANNELS of inputs wherein each channel contains  
10000 inputs.

By the way, the discussion in the above-mentioned site is not so  
clear… sorrry…
