How to share variables when embedding, cloning perl

Hello,

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

I'm extending Perl (with SWIG) and also embedding a cloned interpreter.=A0 =
I use the cloned interpreter to invoke Perl sub's as callbacks.=A0 The call=
back part is working fine.=A0 However, a variable changed in the callback s=
ubroutine 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 "Inval=
id value for shared scalar at".=A0

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

I'm using v5.8.8 perl.=A0 perl_clone() is using CLONEf_COPY_STACKS | CLONEf=
_KEEP_PTR_TABLE.=A0 The perl sub is sv_dup() with the same flags in CLONE_P=
ARAMS before call_sv().

Please see this post that describes my current code.

http://markmail.org/thread/cjbhybjfikuirvud

Thanks=0A=0A=0A
Sri [ Mo, 30 November 2009 19:34 ] [ ID #2024407 ]
Webserver » gmane.comp.apache.mod-perl » How to share variables when embedding, cloning perl

Vorheriges Thema: [PATCH] Apache2::SizeLimit aborts when smaps is not available
Nächstes Thema: Bug in $r->no_cache(1) with mod_expires