Trying to become one with the GC
"Gough, Christopher" <[email protected]>
| Newsgroups | gmane.comp.windows.off-topic |
|---|---|
| Message-ID | <E4AE3AC01780CD4EB19102EB761A72F933639F26D1@USMAIL2K701.us.Micros.int> |
Consider the following code:
Thread t = null;
for (int i = 0; i < 10; i++)
{
t = new Thread( new ThreadStart( Worker ) );
t.Name = string.Format( "Worker Thread {0}", i );
t.Start();
}
My threads go off on their merry way but I don't have any reference to the threads anymore. Are my poor helpless threads now at the mercy of the garbage collector? I suspect they are safe but I'm not 100% positive.
Thanks