Currently, I'm doing:

 char *args[]  = { "jperl", perlfile };
 int  argcount = 2;

 PerlInterpreter* my_perl = perl_alloc();
 PERL_SET_CONTEXT(my_perl);
 perl_construct(my_perl);

 PERL_SET_CONTEXT(my_perl);
 int status = perl_parse(my_perl, xs_init, argcount, args, NULL);
 ...
 PERL_SET_CONTEXT(my_perl);
 // Fill up Parse and Perl DS conversion code here
 PL_PARSE_ARGS;

 int count = perl_call_pv(fname, G_ARRAY | G_EVAL);
 SPAGAIN;
 ...

Doesn't seem like the subsequent PERL_SET_CONTEXT() calls
are needed since I'm using one PerlInterpreter* per pthread.
Once I've set it into my thread's context, then it shouldn't
change, right?

Doesn't seem like the dTHX and aTHX add anything. From looking 
at the macro expansion they just create another local variable
of type PerlInterpreter*.  Is that important?

>      dTHX;
>      PerlInterpreter *one_perl = perl_alloc();
 ...
>      aTHX = one_perl;
>      PERL_SET_CONTEXT(aTHX);

Thanks a bunch!
JD

Reply via email to