Reference counting, Operating System

Assignment Help:

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.


Related Discussions:- Reference counting

What is external fragmentation?, What is external fragmentation? As pro...

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

Explain the exit (status) function, Explain the Exit (status) Function  ...

Explain the Exit (status) Function  Exit function causes the calling process to be terminated. Actually, all file descriptors are immediately closed but the process is   not

What is busy waiting, What is busy waiting? The repeated implementation...

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

Explain medium term scheduling, Medium term scheduling This is componen...

Medium term scheduling This is component of the swapping function. Usually the swapping in decision is based on the need to manage the degree of multiprogramming. At a system t

Explain bounded buffer and unbounded buffer, Explain bounded buffer and unb...

Explain bounded buffer and unbounded buffer. Here in a producer-consumer problem the producer process produces information that is consumed by a consumer process. At this time

If a process is blocked, There is a process bloacked by a semaphore and no ...

There is a process bloacked by a semaphore and no other process in the ready queue, can the blocked process get back to the ready queue without the semsignal() function?

Activities of an operating system, Q. What are the five main activities of ...

Q. What are the five main activities of an operating system in regard to process management? Answer: a. The creation as well as deletion of both user and system processes

Explain banker''s algorithm, Banker's Algorithm In this analogy ...

Banker's Algorithm In this analogy Customers ≡ processes Units ≡ resources, say, tape drive Ba

Several cpu-scheduling algorithms, Q. Several CPU-scheduling algorithms are...

Q. Several CPU-scheduling algorithms are parameterized for instance the RR algorithm requires a parameter to indicate the time slice. Multilevel response queues require parameters

In which page replacement policy balady’s anomaly occurs, In which page rep...

In which page replacement policy Balady’s anomaly occurs? FIFO (First in First Out)

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd