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
A paper mill produces two grades of paper viz., X and Y. Because of raw material restrictions, it cannot produce more than 400 tons of grade X paper and 300 ton

A friend has promised to log in at a particular time. However, he needs to be contacted as soon as he logs in. The shell script checks after every minute whether he has logged in o


Define UFD and MFD. In the two-level directory structure, every user has her own user file directory (UFD). Every UFD has a similar structure, but lists only the files of a one

Question 1 Describe about the shells of Linux operating system Question 2 Describe briefly about GNOME desktop Question 3 Write note on the following- Encryp

Ask questiWhat is dispatcheron #Minimum 100 words accepted#

Deadlock Prevention Prevention is the name given to method that guarantee that deadlocks can never happen for the reason that the way the system is structured. Since 4 conditio

Define drawback of Distributed systems Reliability is a drawback of Distributed systems

Explain about disk scheduling with neat diagram? FCFS Scheduling SCAN scheduling C-SCAN scheduling SSTF scheduling LOOK Scheduling

Q. When a process creates a fresh process using the fork() operation which of the following state is shared among the parent process and the child process? 1 Stack 2 Heap