# Call set\_output\_multiple() on the fly

**URL:** <https://www.ruby-forum.com/t/call-set-output-multiple-on-the-fly/199630>\
**Category:** GNU Radio\
**Created:** [November 25, 2010, 1:12pm UTC](https://www.ruby-forum.com/t/call-set-output-multiple-on-the-fly/199630 "2010-11-25T13:12:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [November 25, 2010, 1:12pm UTC](https://www.ruby-forum.com/t/call-set-output-multiple-on-the-fly/199630/1 "2010-11-25T13:12:07Z")

</div>

I am writing a module that might need dynamic change to the block  
length.  
So I want to call set\_output\_multiple(blk\_len) when the flow graph is  
running.  
Firstly, is this allowed?  
Secondly, what are the effects?  
If I have a “noutput\_items%blk\_len==0” checking in work(), will it fail  
during the transition?  
Thanks  
Kyle

---

<div class="post-metadata">

**Author:** ![Kyle\_Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/6f9a4e/32.png) [@Kyle\_Z](https://www.ruby-forum.com/u/Kyle_Z)\
**Post date:** [November 26, 2010, 1:29am UTC](https://www.ruby-forum.com/t/call-set-output-multiple-on-the-fly/199630/2 "2010-11-26T01:29:19Z")

</div>

On Thu, Nov 25, 2010 at 11:11:27PM +1100, Kyle Z. wrote:

> I am writing a module that might need dynamic change to the block length.  
> So I want to call set\_output\_multiple(blk\_len) when the flow graph is running.  
> Firstly, is this allowed?  
> Secondly, what are the effects?  
> If I have a “noutput\_items%blk\_len==0” checking in work(), will it fail during  
> the transition?  
> Thanks  
> Kyle

There is no guarantee that set\_output\_multiple will work if you change  
it on the fly.

It is possible that you could specify a value for set\_output\_multiple  
that would require reallocation of the impacted buffers. We do not do  
that.

Eric

---

<div class="post-metadata">

**Author:** ![Kyle\_Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/6f9a4e/32.png) [@Kyle\_Z](https://www.ruby-forum.com/u/Kyle_Z)\
**Post date:** [November 26, 2010, 1:56am UTC](https://www.ruby-forum.com/t/call-set-output-multiple-on-the-fly/199630/3 "2010-11-26T01:56:51Z")

</div>

On 26/11/2010 11:28 AM, Eric B. wrote:

> There is no guarantee that set\_output\_multiple will work if you change  
> it on the fly.
> 
> It is possible that you could specify a value for set\_output\_multiple  
> that would require reallocation of the impacted buffers. We do not do  
> that.
> 
> Eric

Thanks Eric.  
How about set\_relative\_rate()? can I call it on the fly?  
Another question: is it thread safe to modify the module’s member  
variables from outside the work()?  
Kyle

---

<div class="post-metadata">

**Author:** ![Kyle\_Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/6f9a4e/32.png) [@Kyle\_Z](https://www.ruby-forum.com/u/Kyle_Z)\
**Post date:** [November 26, 2010, 4:43am UTC](https://www.ruby-forum.com/t/call-set-output-multiple-on-the-fly/199630/4 "2010-11-26T04:43:28Z")

</div>

On Fri, Nov 26, 2010 at 11:55:50AM +1100, Kyle Z. wrote:

> Thanks Eric.  
> How about set\_relative\_rate()? can I call it on the fly?

Small changes are OK. Large changes have the same problem as  
set\_output\_multiple.

> Another question: is it thread safe to modify the module’s member  
> variables from outside the work()?

In general no, unless you do something to make it safe yourself.

Eric
