My next question, and I'm being too lazy to just test it, can a thread that has finished execution (normally, not Abort() or exception) be Start()ed?
As for the StreamWriter.. it's handle would be closed after exiting the method, surely? Or are you telling me the garbage collection is that poor in .NET?
So an object does not get garbage collected when it's reference counter reaches <1 ? :/
OK, I'll add Dispose(); or Close(); to the method when it's finished.
Objects don't have reference counters in the CLR; keeping track of how many references each object has would incur a huge performance hit.
The CLR's GC determines which objects are permanently out of scope by testing each object for reachability – i.e. whether it can be reached from a root object (e.g. an object referenced by a static field). The JVM's GC works in much the same way I believe.
Indeed the JVM does. Generational garbage collector - kinda mark and sweep but better.
So an object does not get garbage collected when it's reference counter reaches <1 ? :/
Yep the CLR also uses generational garbage collection![]()
Smalltalk manages it without loss of performance. So I don't see why CLR can't. But nevermind, this will only end in an evangelical war.
Thanks for the info.