On tisdag, dec 17, 2002, at 13:06 Europe/Stockholm, Aravind Srivaths wrote:

Thanks for the response.

Instead, is it not possible to just increment the reference count
of every variable by overloading its clone method.  The destructor
can then reduce the reference count.  I don't know
enough about cloning to figure out if this will work yet.  Perhaps
the issue is whether tied variables can be shared?
I'm not sure I understand what the problem is here or what you're
trying to achieve or point out.  Could you elaborate?

Ok, let me start with a question instead - is it possible for two
instances of the interpreter to hold one reference each to a variable?
If this is possible, then it must be possible to implement shared
variables by just housing them in a special interpreter instance and
incrementing reference count every time a clone is done.  Is this
how it is really implemented?

Next how is scoping implemented for shared variables - how does the
'special interpreter' where shared variables live know what stash
to fetch the variable from?  I could not figure this from the code.

Thanks,

Arvind

How would you make sure the reference counts are correct without locking?

Arthur

Reply via email to