Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^4: RFR: Inside-out classes - a Class::InsideOut primer

by Joost (Canon)
on Mar 16, 2007 at 15:19 UTC ( #605169=note: print w/ replies, xml ) Need Help??


in reply to Re^3: RFR: Inside-out classes - a Class::InsideOut primer
in thread RFR: Inside-out classes - a Class::InsideOut primer

The real answer: Class::InsideOut expects/requires that the unique key for each object be its memory address (to ensure safety for threading and pseudoforks), so it provides the alias id() to Scalar::Util::refaddr.

I don't have a win32 perl available to test this right now, but doesn't a fork() in win32 perl change the refaddr? If so, does anyone know if Class::InsideOut handles that correctly?


Comment on Re^4: RFR: Inside-out classes - a Class::InsideOut primer
Re^5: RFR: Inside-out classes - a Class::InsideOut primer
by xdg (Monsignor) on Mar 16, 2007 at 15:34 UTC
    does anyone know if Class::InsideOut handles that correctly

    Yes. See Threads and fork and CLONE, oh my!. It's specifically what Class::InsideOut was designed to get right for inside-out objects and what Class::Std still gets wrong.

    Object::InsideOut gets it right, too, and adds features for cross-thread sharing. But the API and features of O::IO are a bit daunting.

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://605169]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2014-09-03 02:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (35 votes), past polls