View Single Post
  #1 (permalink)  
Old 02-15-2008, 04:21 AM
sid
Newsgroup Contributor
 
Posts: n/a
Garbage Collector Trauma

Hi

I have an application written in VB.NET for windows mobile 2005
device. In addition I have 2 unmanaged DLL's written in C which the VB
app uses.

The app runs absolutely fine until the system garbage collector gets
triggered, at which point one of my DLL's (in which I create a
separate thread for some sound recording task) thread gets suspended
and never gets up after that. At this point my application just stops
working.

Is there any way I can mark my THREAD as GC-SAFE so that GC just
bypasses it during its sweep operations.

The intriguiing part is, if I manually trigger the GC with the
following lines (executing these lines quite regularly)

GC.Collect()
GC.WaitForPendingFinalizers()
GC.Collect()

then it seems to be working fine, even when the GC is virtually always
on.

Anyone has any say on this please advise as I am not convinced with
calling the GC commands from within the application.

Cheers
Sid
Reply With Quote

 
Old 02-15-2008, 04:21 AM