Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^4: Outside-in objects with Object::LocalVars (threads)

by xdg (Monsignor)
on Jul 30, 2005 at 08:54 UTC ( #479586=note: print w/replies, xml ) Need Help??

in reply to Re^3: Outside-in objects with Object::LocalVars (threads)
in thread Outside-in objects with Object::LocalVars

So apart from the object ID issues, which is valid for the current implementation of Perl ithreads and fairly easily addressed, your point is that it isn't thread-safe in general against some unimplemented, future version of Perl threading that shares virtual memory but whose other properties are as yet undefined? I'd say that's setting the standard a tad high. That said, your general impression might be correct -- and it's certainly led me to have a crash course on threads in Perl, so I appreciate the feedback

I think the question of whether the "localized globals" approach would work under a shared virtual memory thread depends mostly on the whether the dynamic scoping effects of local are localized to a thread or not. From reading Temporary Values via Local, I would tend to think that might be an important implementation feature -- otherwise, I would think that localizing "magic" variables like $/ and $| wouldn't be thread-safe in your broader definition either.


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?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2023-06-06 15:44 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (29 votes). Check out past polls.