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
Question 1 Brief the following distributed computing system model Question 2 Explain the components involved in implementation of RPC mechanism Question 3 What is

Explain the TlsGetValue (TLSindex) Function Executing this function will return the thread local storage data associated with this thread. The pointer returned will be the one

Locality of reference entails that the page reference being made by a processĀ  Locality of reference entails that the page reference being made by a process is similarly to be

Making the Transition to Client - Server Programming Making the transition to client - server programming is a significant effort. Client - server applications must be designed

Define lazy swapper. Rather than swapping the entire process into main memory, a lazy swapper is used. A lazy swapper never swaps a page into memory unless that page will be ne

Sir i want formulas in Memory management starting from paging till the demang paging in a easy manner for solving problems in competitive exams

To evade race condition, the maximum number of processes that may be at the same time inside the critical section is The maximum number of processes which may be at the same t

Define properties of Real time operating system Real time :- Often used in a dedicated application, this system reads information from sensors and must respond within a fixed a

what are disadvantages of using single directory

Define spooling. A spool is a buffer that holds output for a device, like printer, that cannot accept interleaved data streams. When a request finishes printing, the spooling s