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
Q. Consider a distributed system with two sites A and B. Consider whether site A can distinguish among the following: a. B goes down. b. The link between A and B goes down.

As we have discussed, page tables map virtual page addresses to physical page addresses. One of the advantages of using virtual addresses is that we can achieve complete separation

breifly write a note on about evolution of operating system?

shell script that accepts two directory names as arguments and delete those file in the second directory that are identical to the file in the first

Explain the various methods for handling deadlocks.      A set of processes is deadlocked if every process in the set is waiting for an event that only a process in the

Q. What are two dreadful problems that designers should solve to implement a network-transparent system? Answer: One such issue is making all the processors as well as storag

Explain segmentation hardware? We define an completion to map two-dimensional user-defined addresses into one-dimensional physical addresses. This mapping is affected by means

What is super block A partition control block have partitions details, such as the number of blocks in the partition, size of the blocks, free-blocks and free-block pointers an

Explain what ISAM is. Indexed sequential access method. The file is stored in sorted order. ISAM has a master index file, indicating in what part of another index file the key

Determine the syntax of the assembler directive EQU The following is syntax of the assembler directive EQU: EQU