On Mon, Apr 11, 2005 at 01:54:57PM +0200, Elizabeth Mattijsen wrote:
> Hmmm... wouldn't it be handier to have a method CLONED() which is 
> called for each object (and with the object as parameter) and which 
> is expected to return a cloned objects, ready to be used inside the 
> thread?  If it returns undef, then the object should not be cloned. 
> If it return an object, then that object should be used inside the 
> thread.

No :-(

Because:

a) Perl-level functions can't be called during the middle of cloning,
as the internal state isn't yet consistent.
b) Cloning of objects can't be done at the Perl level, it has to be done
at the C level, eg making sure that memory is allocated from the correct
pool.
c) It would be very expensive to call a Perl function for each object

-- 
The Enterprise is captured by a vastly superior alien intelligence which
does not put them on trial.
    -- Things That Never Happen in "Star Trek" #10

Reply via email to