Finalize times out during shutdown

  • Thread starter Thread starter Jack
  • Start date Start date
J

Jack

It seems that if Finalize takes more than 2 seconds during
the process shutdown, the process will just terminate
anyway. How can I specifically tells GC that this guy's
clean up does suppose to take that long so that please
wait until I finish my job gracefully?
 
Jack said:
It seems that if Finalize takes more than 2 seconds during
the process shutdown, the process will just terminate
anyway.
Yes.

How can I specifically tells GC that this guy's
clean up does suppose to take that long so that please
wait until I finish my job gracefully?

I don't know that there's any way of doing that during shutdown - if
you've got something to finish, it would be much better to do it before
you start the shutdown process.
 
Hi Jack

No, there's no way to change the Finalizer timeout. This is to avoid an object's finalizer from starving other finalizers, or causing the runtime to hang.

You should consider using the Dispose pattern to free up any resources before shutdown, and then you can take as long as you need to.

Hope that helps
-Chris

--------------------
Content-Class: urn:content-classes:message
From: "Jack" <[email protected]>
Sender: "Jack" <[email protected]>
Subject: Finalize times out during shutdown
Date: Thu, 13 Nov 2003 13:03:32 -0800
Lines: 5
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcOqKZh5r68wFS0BTmu7zPcmiKZxyA==
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:115548
NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
X-Tomcat-NG: microsoft.public.dotnet.general

It seems that if Finalize takes more than 2 seconds during
the process shutdown, the process will just terminate
anyway. How can I specifically tells GC that this guy's
clean up does suppose to take that long so that please
wait until I finish my job gracefully?


--

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.
 
Back
Top