Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Reference counting
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Weighted reference counting=== In weighted reference counting, each reference is assigned a ''weight'', and each object tracks not the number of references referring to it, but the total weight of the references referring to it. The initial reference to a newly created object has a large weight, such as 2<sup>16</sup>. Whenever this reference is copied, half of the weight goes to the new reference, and half of the weight stays with the old reference. Since the total weight does not change, the object's reference count does not need to be updated. Destroying a reference decrements the total weight by the weight of that reference. When the total weight becomes zero, all references have been destroyed. If an attempt is made to copy a reference with a weight of 1, the reference has to "get more weight" by adding to the total weight and then adding this new weight to the reference, and then splitting it. An alternative in this situation is to create an ''indirection'' reference object, the initial reference to which is created with a large weight which can then be split. The property of not needing to access a reference count when a reference is copied is particularly helpful when the object's reference count is expensive to access, for example because it is in another process, on disk, or even across a network. It can also help increase concurrency by avoiding many threads locking a reference count to increase it. Thus, weighted reference counting is most useful in parallel, multiprocess, database, or distributed applications. The primary problem with simple weighted reference counting is that destroying a reference still requires accessing the reference count, and if many references are destroyed, this can cause the same bottlenecks we seek to avoid. Some adaptations of weighted reference counting seek to avoid this by transferring weight from a dying reference to an active reference. Weighted reference counting was independently devised by [[David Bevan (mathematician)|Bevan]]<ref>{{cite conference | first=D. I. | last=Bevan | title=Distributed garbage collection using reference counting | book-title=Volume II: Parallel Languages on PARLE: Parallel Architectures and Languages Europe | year=1987 | place=Eindhoven, The Netherlands | pages=176β187 | publisher=Springer-Verlag | isbn=0-387-17945-3 }}</ref> and Watson & Watson<ref>{{cite conference | first1=Paul | last1=Watson | first2=Ian | last2=Watson | title=An efficient garbage collection scheme for parallel computer architectures | book-title=Volume II: Parallel Languages on PARLE: Parallel Architectures and Languages Europe | year=1987 | place=Eindhoven, The Netherlands | pages=432β443 | publisher=Springer-Verlag | isbn=0-387-17945-3 }}</ref> in 1987.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Reference counting
(section)
Add topic