How to share variables when embedding, cloning perl

Sri <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
Hello,

I havent found any relevant posts on this topic, so hoping the experts can rescue me.  My posts on p5p and ithreads didnt get any responses.

I'm extending Perl (with SWIG) and also embedding a cloned interpreter.  I use the cloned interpreter to invoke Perl sub's as callbacks.  The callback part is working fine.  However, a variable changed in the callback subroutine is NOT becoming available in the rest of the perl script.

I tried to "use threads:shared" and ":shared" the variable in question, but perl exits, complaining that another completely unrelated scalar is "Invalid value for shared scalar at".  

How can I "share" variable updates between the main perl script and the callbacks invokved thru the cloned interpreter?

I'm using v5.8.8 perl.  perl_clone() is using CLONEf_COPY_STACKS | CLONEf_KEEP_PTR_TABLE.  The perl sub is sv_dup() with the same flags in CLONE_PARAMS before call_sv().

Please see this post that describes my current code.

http://markmail.org/thread/cjbhybjfikuirvud

Thanks
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.