Reference counting, Operating System

The idea of reference counting is to maintain, for every object, the total number of references to that object, i.e. the number of "incoming" pointers. Whenever the number of references is zero we know that the object is not accessible through any pointers, and thus it is garbage. Also, whenever we choose to delete some useless object,we have to recursively check that object to see if it contains pointers to other objects; if so, we have decrement the reference counters for those objects as well. One problem of reference counting, though, is how to deal with cycles. Suppose object A points to B, and B points to A. If these objects can only be reached through each other, we have to free them too, even though their counters are not zero! Note that cycles can common inmany data structures; for example, consider a doubly-linked list. The commonly adopted solution to this problem is to run mark-sweep now and then, in order to remove cyclic references, and then run normal reference counting on the rest of the time.

Posted Date: 3/13/2013 2:56:10 AM | Location : United States







Related Discussions:- Reference counting, Assignment Help, Ask Question on Reference counting, Get Answer, Expert's Help, Reference counting Discussions

Write discussion on Reference counting
Your posts are moderated
Related Questions
We are use to using variables within C without thinking about where they are stored. Most variables are dynamic i.e. can change, therefore they are stored in Ram, unlike a program



How is memory management done using linked lists?   Each one node of the l list will have 4 fields as follows 1-this tells whether it s a hole or a process 2-starting ad

There is a very small amount of networking background required for Project 2. In Project 2, we want our computer (or our "host") to request information over the Internet from a rem

How can the deadlock be prevented Bankers algorithm : The Resource allocation graph algorithm isn't applicable to a resource allocation system with multiple instances of every

Q. How does NTFS handle data structures? How does NTFS recover from a system crash? What is guaranteed after a recovery takes place? Answer: In NTFS all file-system data stru

What are the allocation methods of a disk space? Methods of allocating disk space which are widely in use are a. Contiguous allocation b. Linked allocation c. Indexed

Consider a particular system that does not have an interrupting clock.  The only way a thread can lose the processor is to voluntarily surrender it.  Additionally, the operating sy

Ask questioDevelop a utility in C language which will run in Linux operating systems to display following properties of the system: ? Processor speed ? Ram size ? Computer name ? S