On Wednesday 10 October 2007 21:20, Philippe M. Chiasson wrote: > The only question I have is wherever it's necessary to also expose the > following 2 items: > > modperl_interp_pool_t * | IV > PerlInterpreter * | IV > > Especially in the current patch, what you get out will pretty much > be a useless blessed scalar you can't do anything with.
Without these 2 lines no accessor methods would be created because the wrapxs process obviously doesn't know how to convert it. In my first version I had declared mip and perl as void* in xs/tables/current/Apache2/StructureTable.pm. This way I also got these members compiled in. But then I suspected that a source scan would never generate that. Am I right? BTW, I forgot to mention, the patch creates a new map: xs/maps/modperl_structures.map. Is that OK? > Apart that, looks great. At this point, I'd be happy to see it go in, > without documentation even, but at least with a minimal set of tests, > something like: > > my $int = ModPerl::Interpreter->current; > ok($int); > is($int, 'ModPerl::Intereter'); > > ok($int->mip); > ok($int->refcnt); > [...] > > To at least cover normal usage cases. Of course. I need this module mainly for testing the interpreter management. The pair ($$interp, $interp->num_requests) can be used as unique identifier for one particular usage (the time between interp_select and interp_unselect) of that interpreter. refcnt is used to check for example if creating pnotes would lock the interp. mip and perl are currently not used. They can be dropped if you think that would be better. I am aware that if later on someone decides that a perl interface to the mip structure would be good he has to change the API. But that can be documented. On the other hand mip may be a useful tool to check if a vhost with +Parent has really got a separate mip. But then an interface to the mip->tipool might be useful to check how much interpreters are in use at a certain point in time. Maybe I should provide a perl interface to that too. Torsten
pgp6J4u3fe3Cd.pgp
Description: PGP signature