in reply to Perl calls C calls Perl CallBack: How Perl callback use the same interpreter/context as Perl caller?

You may find the thread at Perl crash during perl_clone contains a lot of relevant information.

Be warned. It is a long and deep thread with much of the best information coming towards the end; down around Re^24: Perl crash during perl_clone.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re: Perl calls C calls Perl CallBack: How Perl callback use the same interpreter/context as Perl caller?

Replies are listed 'Best First'.
Re^2: Perl calls C calls Perl CallBack: How Perl callback use the same interpreter/context as Perl caller?
by itamarat (Acolyte) on Jul 08, 2014 at 13:34 UTC

    Hi,

    Thanks for your reply!

    I've tried to use Perl_get_context() (or dTHX) and got NULL.

    Currently, I don't understand how to get the pointer of the interpreter of the Perl function that calls the C function.

    My system structure:
    Perl function --> C DLL --> Perl Callback

    The requirement is that the Perl function and the Perl callback will work from the same context.


    Many thanks and best regards,

    Itamar

      May your C DLL be loading and using Perl.DLL to resolve symbols instead of linking back to the perl executable?