Adam Olsen wrote:
> Reference counting turns all references into
> modifications.
> 
> There's a few ways to approach this:

I've just thought of another one: Instead of a single
refcount per object, each thread has its own set of
refcounts. Then the object has a count of the number
of threads that currently have nonzero refcounts for
it.

Most refcount operations would only affect the
thread's local refcount for the object. Only when that
reached zero would you need to lock the object and
update the global refcount.

Not sure what kind of data structure you'd use for
this, though...

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,          | Carpe post meridiem!                 |
Christchurch, New Zealand          | (I'm not a morning person.)          |
[EMAIL PROTECTED]          +--------------------------------------+
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to