Possibilty of GC.WaitForPendingFinalizers().
In my desktop application am using following .net functions
GC.Collect();
GC.WaitForPendingFinalizers();
I just want to know that, is there possibility that WaitForPendingFinalizers() will wait for indifinite time ?
If so ,what is the way to get out of it so that my application can proceed further.
Nitin Daphale
Junior Poster in Training
64 posts since Apr 2010
Reputation Points: 10
Solved Threads: 0
>what is the way to get out of it so that my application can proceed further.
Text from MSDN - http://msdn.microsoft.com/en-us/library/system.gc.waitforpendingfinalizers.aspx
SUMMARY:
The thread on which finalizers are run is unspecified, so there is no guarantee that this method will terminate. However, this thread can be interrupted by another thread while the WaitForPendingFinalizers method is in progress. For example, you can start another thread that waits for a period of time and then interrupts this thread if this thread is still suspended.
__avd
Posting Genius (adatapost)
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241