Re: shared variable and scopes: implementation

2002-12-19 Thread Aravind Srivaths
> How would you make sure the reference counts are correct without > locking? > Yes, a lock is required per variable, but these locks can be stored in a separate hash, keyed by variable address and magic can be used to lock a variable before accessing. It should be possible for multiple interp

Re: shared variable and scopes: implementation

2002-12-19 Thread Elizabeth Mattijsen
At 15:21 +0530 12/19/02, Aravind Srivaths wrote: It should be possible for multiple interpreters to hold a reference to the same variable (contrary to what Elizabeth says) - after all the variable just resides in a heap and all threads share the data space. Is that statement true for _all_ syste

Re: shared variable and scopes: implementation

2002-12-19 Thread Arthur Bergman
On torsdag, dec 19, 2002, at 10:51 Europe/Stockholm, Aravind Srivaths wrote: Yes, a lock is required per variable, but these locks can be stored in a separate hash, keyed by variable address and magic can be used to lock a variable before accessing. Huh, magic is already used to do the locki

Re: shared variable and scopes: implementation

2002-12-18 Thread Arthur Bergman
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 a

Re: shared variable and scopes: implementation

2002-12-17 Thread Elizabeth Mattijsen
At 17:36 +0530 12/17/02, Aravind Srivaths wrote: > 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 t

shared variable and scopes: implementation

2002-12-17 Thread Aravind Srivaths
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 is