I'm a C++ guy, so this kinda makes me think of auto_ptr<>'s and their reset method except that doesn't actually copy... actually this sounds more like a copy constructor; what about copy_construct() ???
I haven't done C++ for a long time, but if I remember correctly copy_construct() is invoked on the existing object and it doesn't modify the original, but returns a new object. Here the situation is different: Perl has already invoked its copy_constructor and gave you the resulting object, so all is left is to copy the C struct and modify the passed object's IV slot. So this is sort of a copy_construct on the guts of the object...
So it's more like a deepcopy_reconstructor()? Yea, I don't know a nice way to say that.
Yup.
In fact if it didn't have a problem with destroy (which is possible to workaround in the destroy method by tracking who created the original object), I'd say that this is a Copy-On-Write situation, as long as nobody modifies the object it's perfectly find to have several objects pointing to the same C structs from different threads. If you ever create an object in the parent perl and never modifying it, it'll be much more efficient, than blindly reconstruct all variables. Only when the object wants to be modified, it will be then reconstructed and modified, without affecting any other threads. You don't even need mutexes for this to work. This could be made into yet another handy reusable module, I'm sure Liz will post an announcement in the next few minutes ;)
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
