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
Give a brief introduction about the operation of your program and show that you understand the idea behind threads and mutual exclusion variable. Why do we need to use mutual exclu

Define drawback of Distributed systems Reliability is a drawback of Distributed systems

What is a client server system? Centralized systems proceed as server systems to satisfy request generated by client systems Server system is able to be broadly div

Discuss in detail Table management Techniques?     An Assembler employs the subsequent tables: OPTAB: Operation Code Table consists of mnemonic operation code and its machi

Q. How Program execute in operating system? Program execution: Operating system loads a program in memory and executes the program. The program should be able to end its exec

What are the various page replacement algorithms used for page replacement? FIFO page replacement Optimal page replacement LRU page replacement LRU approximat

What is busy waiting? The repeated implementation of a loop of code while waiting for an event to happen is known as busy-waiting. The CPU is not engaged in any actual producti

i need the job to be done within 3days

What is spooling? Spooling overlaps the I/O of single job with the computation of other jobs.

What is a semaphore? A semaphore 'S' is a synchronization tool which is  an integer value that, apart from initialization, is accessed only by two standard atomic operations; w