Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: Dev

running code references in different interpreter contexts...

 

 

ModPerl dev RSS feed   Index | Next | Previous | View Threaded


cying at sendmail

Jul 10, 2000, 2:33 PM

Post #1 of 1 (963 views)
Permalink
running code references in different interpreter contexts...

In a module I'm writing for 5.6.0 and ithreads, I've got this code that
does rudimentary interpreter pools, ala perl_clone()....

Unfortunately, if I try to call_sv on a code reference from the parent
interpreter in one of the child interpreters, the routine gets no
arguments and upon a second invocation of that routine, perl decides to
segfault on me. :)

Now, having function names as strings works fine, since a get_cv is made
from call_sv which gets the appropriate "magic" from the child interpreter
to make things work right. But I want to support actual code references,
since my users might want to pass in code references instead of strings
with function names.

I read dougm's comments on this in modperl_callback(), which say that
under ithreads, each handler needs to get_cv() from the selected
interpreter so the proper CvPADLIST is used.

I dug around for something that might do it, and found an undocumented
Perl_sv_dup, which duplicated SVs with their CvPADLISTs (if the values are
CVs). I tried that, and everything "worked"... The thing is, I don't know
if this is the right thing to do...

Thoughts?

-- Charles

ModPerl dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.