[gclist] Multi threaded reference counting

Henry G. Baker hbaker@netcom.com
Sat, 18 Jan 1997 15:41:49 -0800 (PST)


> I am trying to figure out how to do multi threaded reference counting
> and have only one problem. When an object's ref count drops to zero
> you can't free it immediately because it is not possible to atomically
> dereference the object and decrement its count, another object
> might have incremented it while you were decrementing it. 

Huh?  If the reference count is _really_ the reference count, then
refcount=0 means that _you_ are the only one who can reference it, and
there can't possibly be any contention.

Of course, this finesses the whole issue of how you get a _real_
reference count in a multi-threaded system in the first place.

There has been a lot of work done on this problem under the guise
of 'distributed GC'.  Perhaps a web search will turn up something....

-- 
Henry Baker
www/ftp directory:
ftp.netcom.com:/pub/hb/hbaker/home.html