My question is this: is it possible, in my C app, to save off the state of the interpreter and restore it later?

Sure you can, just as you can write a relational database in assembly.

Realistically you need to ask bigger questions of why? Why not just put it in hibernate? Why not save off the whole OS run-state which I believe you can do with hypervisors like vmware. You need to be able to ask the bigger question of why you want to do this.

It may be as easy as using Storable as one point, depending upon how the c/perl is stitched together.

Are there just a few global type objects, singletons, from which all other data within your perl code hang?

My suggestion is to draw pictures, I like pictures, and show what is in the perl code, what is in the code, how they communicate, what triggers communication, etc.

You can not well address this issue without a clear understanding of the architecture - yes you may have written it, but take a 50,000 ft view, not the 10 ft view, along with why, what is the driving issues, and the answer will probably pop right out.


In reply to Re: Embedded Perl - Saving State? by otto
in thread Embedded Perl - Saving State? by McD

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.