Anno's solution looks pretty good to me, but sharing objects across threads doesn't work "out of the box". It might be fixable but my perl/threads knowledge is pretty basic.
Question: is there any hook to catch that an object is shareable (i.e. shared() is called on it) or does the call to CLONE specify that somewhere? I can't seem to find any decent documentation on CLONE().
XS hooks seem to be very straightforward to implement with this technique. Much easier than with inside-out objects, anyway.
In reply to Re^4: Really Writing Object Oriented Perl
by Joost
in thread Really Writing Object Oriented Perl
by agianni
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |