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
In this exercise we are going to use  pthread()to simulate the dynamics between a warehouse, factory and retail. The factory produces product by using parts supplied by the warehou

Can a direct access file be read sequentially? Explain. Yes. Keep a counter, cp, initially set to 0. After reading record cp, increment cp.

Organizational, Structural, Logical and Execution Relationships Between Important System Components in Linux Kernel Subsystems A. Description of the Project You are require

Q. In a ring-protection system the level 0 has the greatest access to objects and level n (greater than zero) has fewer access rights. The access rights of a program at a partic

What is external fragmentation? As process are removed from and loaded to the memory free memory space is bracken into pieces .external fragmentation take place when enough mem

As a group, you may need to make some enhancements to your development server (NOT your stable server!)  It needs to be able to run the makepasswd program, which may require instal

What is Directory? The device directory or simply called as directory records information-such as name, location, size, and type  for all files on that certain partition. The d

Explain the TlsSetValue (TLSindex, dataPtr)Function The TlsSetValue function  associates the  dataPtr passed as a parameter as local storage for the requesting thread. The asso

Define Middleware to Ease the Low-Level Protocol Burden Fortunately, many products are available today to ease the low-level protocol burden on the application programmer. Midd

What are the objectives for a file management system? To meet the data management wants and requirements of the user, which embrace storage of data and the ability to