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 is the use of multiprogramming on individual processors ? In the usual multiprocessor, which is dealing with independent or coarse-grained synchronization granularity, it i

What is real time system? A real time system has well explained, fixed time constraints. Processing must be done within the explained constraints, or the system will fail. It i

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

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

Major page fault: If the page is not loaded in memory at the time the fault is stated, then it is named major or hard page fault. The handler in the machine requires to search a

Write a short note about process. Unceremoniously, a process is a program in implementation. A process is too much than the program code, which is occasionally known as the tex

Message passing system:- The function of message system is to permit processes to communicate with one another without the requirement to resort (option) to shared data. Commun

Q. What are the tradeoffs concerned in rereading code pages from the file system versus using swap space to store them? Answer: If codes pages are accumulate in swap space th

Q. More than one disk drive is able to be attached to a SCSI bus. Especially a fast wide SCSI-II bus can be connected to at most 15 disk drives. Remember that this bus has a bandw

Q. Regard as a logical address space of eight pages of 1024 words every mapped onto a physical memory of 32 frames. a. How several bits are there in the logical address? b. H