# Saving block status

**URL:** <https://www.ruby-forum.com/t/saving-block-status/215719>\
**Category:** GNU Radio\
**Created:** [January 13, 2012, 5:12pm UTC](https://www.ruby-forum.com/t/saving-block-status/215719 "2012-01-13T17:12:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [January 13, 2012, 5:12pm UTC](https://www.ruby-forum.com/t/saving-block-status/215719/1 "2012-01-13T17:12:22Z")

</div>

Hi!

I’ve been working on the development of a Digital TV transmitter on GNU  
Radio.  
The problem is that the information flow is bufferized before “entering”  
the blocks, but the information i need to process is too large to be  
bufferized.  
So, I need the data contained on some internal structures of my blocks  
(for  
example, shifters) to be preserved between the executions of each  
bufferized part of the data flow. One of the alternatives is saving this  
data in files and reloading then on the initialization, but i think this  
may ruin my performance.  
I’ve read on  
this[http://gnuradio.org/redmine/projects/gnuradio/wiki/BlocksCodingGuide#Saving-state](http://gnuradio.org/redmine/projects/gnuradio/wiki/BlocksCodingGuide#Saving-state)  
tutorial, that exists the possibility to save the status between  
executions  
using the methods start() ans stop() from the block, but i cannot find  
more  
information about that. Is that the correct way to solve this problem?  
If  
so, where can i find more information about those methods?

Thank you!

---

<div class="post-metadata">

**Author:** ![SSAndrSS\_SelvaSS\_SS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f05b48/32.png) [@SSAndrSS\_SelvaSS\_SS](https://www.ruby-forum.com/u/SSAndrSS_SelvaSS_SS)\
**Post date:** [January 13, 2012, 6:34pm UTC](https://www.ruby-forum.com/t/saving-block-status/215719/2 "2012-01-13T18:34:10Z")

</div>

On 01/13/2012 08:11 AM, Andr S. wrote:

> data in files and reloading then on the initialization, but i think this  
> may ruin my performance.  
> I’ve read on  
> this[http://gnuradio.org/redmine/projects/gnuradio/wiki/BlocksCodingGuide#Saving-state](http://gnuradio.org/redmine/projects/gnuradio/wiki/BlocksCodingGuide#Saving-state)  
> tutorial, that exists the possibility to save the status between executions  
> using the methods start() ans stop() from the block, but i cannot find more  
> information about that. Is that the correct way to solve this problem? If  
> so, where can i find more information about those methods?

The idea behind “saving state” was to help users make their blocks  
robust against the flow graph starting/stopping. This is starting and  
stopping of processing as a whole, so it doesnt help your case which is  
“what to do” while processing. So, if you dont have enough CPU memory to  
buffer, than the only options two you mentioned.

Or is it the case that you just need gnuradio buffers to be larger, and  
everything would therefore work out better for your processing  
implementation?

-Josh

---

<div class="post-metadata">

**Author:** ![SSAndrSS\_SelvaSS\_SS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f05b48/32.png) [@SSAndrSS\_SelvaSS\_SS](https://www.ruby-forum.com/u/SSAndrSS_SelvaSS_SS)\
**Post date:** [January 14, 2012, 3:44pm UTC](https://www.ruby-forum.com/t/saving-block-status/215719/3 "2012-01-14T15:44:26Z")

</div>

I think that making the buffer larger wouldn’t help much.

My problem is: I have an interleaver, where i pass my data through. This  
interleaver is made of several shifters, of different sizes. The input  
goes  
through the shifters in an especific order (given by keying), and the  
output is formed by keying the shifters output in a different order. The  
problem is that if the buffer finishes and i lost the data inside the  
shifters, i’ll lost data. So i need to conservate this structures among  
each bufferized execution of the block.

Is that possible? What i think that may be helpful is some sort of  
global  
structure where i can store this status.

Best Regards,

2012/1/13 Josh B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![SSAndrSS\_SelvaSS\_SS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f05b48/32.png) [@SSAndrSS\_SelvaSS\_SS](https://www.ruby-forum.com/u/SSAndrSS_SelvaSS_SS)\
**Post date:** [January 14, 2012, 4:37pm UTC](https://www.ruby-forum.com/t/saving-block-status/215719/4 "2012-01-14T16:37:06Z")

</div>

On 01/14/2012 09:42 AM, André Selva wrote:

> Is that possible? What i think that may be helpful is some sort of  
> global structure where i can store this status.
> 
> Best Regards,  
> It’s C++, when you instantiate the block, you can allocate whatever  
> structures you want to maintain state across invocations of your  
> work() function. Just make sure that your destructor deallocates  
> said state maintaining structures.

–  
Marcus L.  
Principal Investigator  
Shirleys Bay Radio Astronomy Consortium

> **[Live Draw HK Tercepat | Result HK | HK Pools | Live HK | HK Prize Hari Ini](https://www.sbrac.org)**
>
> Temukan live draw hk tercepat melalui halaman hk pools yang resmi dan dapatkan result hk prize melalui live hk secara langsung di situs kami.
