# How to pass a large number of items between blocks?

**URL:** <https://www.ruby-forum.com/t/how-to-pass-a-large-number-of-items-between-blocks/241115>\
**Category:** GNU Radio\
**Created:** [May 13, 2014, 7:28pm UTC](https://www.ruby-forum.com/t/how-to-pass-a-large-number-of-items-between-blocks/241115 "2014-05-13T19:28:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [May 13, 2014, 7:28pm UTC](https://www.ruby-forum.com/t/how-to-pass-a-large-number-of-items-between-blocks/241115/1 "2014-05-13T19:28:12Z")

</div>

Hi,

I recently encountered a problem with the large number of items. I wanna  
pass about 75000 items from one block to the another. I thought that I  
could do this with setting the min of output items in the constructor of  
the block but I got the following error by runtime:

thread[thread-per-block[1]: \<block crc (1)\>]: Buffer too small for  
min\_noutput\_items

I searched around but I couldn’t find a cogent response. please help me!

Any idea please?

best,  
Mostafa

---

<div class="post-metadata">

**Author:** ![mostafa\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5e9695/32.png) [@mostafa\_a](https://www.ruby-forum.com/u/mostafa_a)\
**Post date:** [May 14, 2014, 10:35am UTC](https://www.ruby-forum.com/t/how-to-pass-a-large-number-of-items-between-blocks/241115/2 "2014-05-14T10:35:31Z")

</div>

On 13.05.2014 19:27, Mostafa A. wrote:

> I searched around but I couldn’t find a cogent response. please help me!  
> You could use your own version of tagged streams to indicate  
> boundaries… regular tagged stream blocks also suffer from buffer  
> limitations.

That said, 75000 items doesn’t seem all that large. What’s your item  
size, is it sizeof(gr\_complex)? Did you set your kernel.shmmax =  
2147483648?

M

---

<div class="post-metadata">

**Author:** ![mostafa\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5e9695/32.png) [@mostafa\_a](https://www.ruby-forum.com/u/mostafa_a)\
**Post date:** [May 15, 2014, 8:18am UTC](https://www.ruby-forum.com/t/how-to-pass-a-large-number-of-items-between-blocks/241115/3 "2014-05-15T08:18:14Z")

</div>

Hi Martin,  
I finally found the solution. I the method \*set\_align(int ), \* to tell  
the  
scheduler output is multiple of a number but this is different than  
set\_output\_multiple(int ). The set\_align will decrease the amount of  
buffer  
if the output number of items is less than the actual number of written  
output until the output buffer aligned with the number of items will  
written on it!

This is interesting.

best,

---

<div class="post-metadata">

**Author:** ![mostafa\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5e9695/32.png) [@mostafa\_a](https://www.ruby-forum.com/u/mostafa_a)\
**Post date:** [May 14, 2014, 11:30am UTC](https://www.ruby-forum.com/t/how-to-pass-a-large-number-of-items-between-blocks/241115/4 "2014-05-14T11:30:55Z")

</div>

Hi Martin,  
Yes you’re right, 75000 items isn’t so large! But after passing these  
items  
through an encoder, the number of items becomes about 227000!! That’s a  
big  
number!

However, I skewed over the problem and till now I’ve reached to this  
point  
that I may use 3 or 4 inputs-ouputs ports per block (instead of actually  
one input-ouput port) and divide the 227000 items into 4 parallel  
streams  
and read all of them through 3/4 different input ports and put them out  
to  
the 3/4 output ports ! That seems work but I’m not sure that’s the best  
one.

If you have any idea I’ll be appreciate you so much.

best,
