Hello brothers,

I'm trying to embed several perl interpreters in C. The interpreters can be used in an interleaved fashion, i.e. there are running several of them "at the same time". Here is the source code.

The program creates two perl interpreters and both of them try to load the module Module::Runtime. The problem is that it crashes or cycles infinitely when it tries to load the module into the second interpreter.

For the sake of completeness there are two routines that load the module (perl_load_module_1 and perl_load_module_2). Neither of them works.

I have compiled it with the command:

gcc -o $@ $^ `perl -MExtUtils::Embed -e ccopts -e ldopts`

I've also tried to load other modules instead of Module::Runtime and all of them worked flawlessly.

I use the most recent perl-5.12.3, Mod::Runtime version is 0.007. Running perl -V gives me: http://pastebin.com/GvvciPSJ

I have been fighting this for over a week to no avail. In the end I used Module::Load instead of Module::Runtime, but nevertheless I would like to know where is the real problem.

Thank you very much for any replies.

daneus


In reply to Multiple perl interpreters and Module::Runtime by daneus

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.