The objects of type FileStream or DB handles have to be properly closed as it use Windows handles internally. Likewise, Threads also use Windows handles right? Does thread has some internal mechanisms to release those Windows handles?
Asked
Active
Viewed 39 times
1 Answers
2
Thread does not implement IDisposable
so it can't be disposed unlike Stream
or DB related objects.
Runtime takes care of necessary cleanup of related native object when thread's code finishes execution and GC will normally take care of managed Thread
object similarly to other finalizable objects.
Note that there is no direct consistent relationship between OS and managed threads Getting the thread ID from a thread.

Community
- 1
- 1

Alexei Levenkov
- 98,904
- 14
- 127
- 179
-
On a side note, I've been always [curious](http://stackoverflow.com/q/18436409/1768303) if there is any existing CLR host where there is no 1:1 mapping between managed and unmanaged threads. – noseratio Jan 30 '14 at 07:52
-