Hello, I'd consider myself new to threading and I fear I am giving my GarbageCollector too much work :p
I have a list (currently ~10 items). When the user pushes the Start button, it needs to call the DoProcess sub, passing each item as a parameter.
Currently I have:
Now, the DoProcess sub runs recursively.. that is:
The program works perfectly until ~2/3 hours in, it will crash with an OutOfMemory Exception thrown.
Do I need to be disposing of my threads? Any advice would be great at this point, I'm running out of ideas.
I have a list (currently ~10 items). When the user pushes the Start button, it needs to call the DoProcess sub, passing each item as a parameter.
Currently I have:
Code:
For x As Integer = 0 To items.Count - 1
Dim index As Integer = x
ThreadPool.QueueUserWorkItem(Sub() DoProcess(items.(index)))
Next
Code:
Sub DoProcess(item As String)
'does some processes...
DoProcess(item)
Do I need to be disposing of my threads? Any advice would be great at this point, I'm running out of ideas.