In the following code:
public void f()
{
List l1<int> = new List<int>();
List l2<int> = new List<int>();
//.. populate l1 and l2
ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(object state)
{
// use l1 and l2
// force gc.collect l1 and l2?
}));
//..
}
l1 and l2 are Thread local very large lists. When do they become eligible for garbage collection? When the thread is done executing the block, do they become eligible?
Is it a good idea to force garbage collection of l1 and l2 when the thread is done with them?
thanks