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

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


Define Overflow Chaining Another method will divide the pre-allocated table into two sections: the primary area to determine which keys are mapped and an area for collisions, g

The following is a dump of a TCP header in hexadecimal format: 00CD0018 00000EF1 00000D5D 502200D1 01BF0010 We need to first split the above hex as such 00 CD 00 18 00 00

my Operating System is windows trust but when the windows start say its windows xp. help pleaes

Q. Consider the following page-replacement algorithms. Rank the algorithms on a five-point scale from "bad" to "perfect" according to their page-fault rate. Detach those algorithm

What are files and explain the access methods for files? File definition Attributes, operations and types Direct access Sequential access with diagram Other access

Q. Explain the actions taken by a kernel to context switch between kernel level threads. Answer: Context switching among kernel threads classically requires saving the value

why we say " OS is a resource allocator" and “OS is a control program"?