[ I am sure it would increase readability of this thread
if you quoted a bit of context. ]
Also sprach Jeff:
> The function call is executing in the new perl context. I can see this
> in the debugger, and if it wasn't executing in the newly cloned
> context, it would work.
>
> I believe the problem is that the function reference I'm calling is
> from the parent interpreter, and its CV value is pointing to the parent
> interpreter, not the cloned interpreter.
That sounds plausible.
> Any ideas on how to fix this?
As always in such cases, it's now probably necessary to try some of the
non-public stuff found in the source that has a promising name.
You might want to try it with applying sv_dup() to the callback SV. Its
prototype:
SV * Perl_sv_dup(pTHX_ SV *sstr, CLONE_PARAMS* param);
'CLONE_PARAMS' is:
struct clone_params {
AV* stashes;
UV flags;
PerlInterpreter *proto_perl;
};
'flags' seem to be those of perl_clone(). Looking at the source of
sv_dup(), 'stashes' is probably irrelevant in your case. 'proto_perl'
doesn't seem to be used for anything either but it can't hurt to store
perl_clone()'s return value there.
Other than that, skimming through ext/threads/threads.xs could be a good
idea (Perl_ithread_create() in particular).
Tassilo
--
use bigint;
$n=71423350343770280161397026330337371139054411854 220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($ m+=

<=200);