Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Search Your Question

Tuesday, May 6, 2008

Is the lack of deterministic destruction in .NET a problem? What is the procedure when you have to do a deterministic

Although it cannot be categorise as a problem but It's an issue that affects component design. If in your program there are objects that maintain expensive or scarce resources (e.g. database locks), you need to provide some way to release the resource when it is done.

Microsoft recommend that you provide a method called Dispose() for this purpose. However, this causes problems for distributed objects - in a distributed system who calls the Dispose() method? Some form of reference-counting or ownership-management mechanism is needed to handle distributed objects - unfortunately the runtime offers no help with this.

To do deterministic garbage collection we can call System.GC.Collect();

No comments:

Archives