[Chicago-talk] What's up with threads not sharing objects

Steven Lembark lembark at wrkhors.com
Sun Apr 11 18:37:54 CDT 2004

-- me at heyjay.com

> I thought I read that you can't share objects.  I'm trying to find where I
> read that.

I'll save you some time: you didn't read it anywhere.

The perl threading model localizes lexicals, which may
be what you're thinking of. Nothing w/in the threading
model forces privitazation of blessed referents.

Obviously, you have to be careful in handling the shared
data structures. But once they are share-able the struct's
are common to all threads.

You cannot share data structs internally across forks,
but evern that can be coverome via shared memory. The
separation of data between separate processes forked
from the same parent may be what you're thinknig of
with the issue on strruct's between threads?

> See if you can share an object and update it with both threads

Why would you expect that I cannot?

Have you read the perlthrtut?

Steven Lembark                               2930 W. Palmer
Workhorse Computing                       Chicago, IL 60647
                                            +1 888 359 3508

More information about the Chicago-talk mailing list