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
with the aid of diagrams describe the following os structures monolithic , layered, client server

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

Question : a) What do you understand by a Directory Structure? Support your answer with a diagram. b) Give an example how Access Lists and Groups are arranged to mode of

Write a short note on disk structure Modern disk drives are initiate as large one dimensional array of logical blocks where the logical block is the smallest unit of transfer.

Parent and Child process communicate in unix A child and parent can interact through any of the normal  inter-process communication schemes (pipes, message queues, sockets, s

As mentioned earlier, the game engine will be used as the base of developing the Go game for the Android. This includes improving logic of the game, design good graphics and optim

Thermostats are subjected to rigorous testing before they are shipped to air conditioning technicians around the world. Results from the last five samples are shown in the table. D

Do ratio analysis by comparing the four companies financial statements, analysis and interpretation on the four-basic group : (Refer to attachment A) Liquidity ratio Asset


Explain about threading issues? The fork and exec system calls In a multithreaded program of few UNIX systems have chosen to have two versions of fork, one that duplicates e