How to get thread id for a managed thread?

This question comes up from time to time. The answer is, there is no explicit numeric thread id for managed thread today in .Net framework.

Now if you do need a numeric thread id for whatever reason, you can use System.Threading.Thread.GetHashCode(). This is documented here.  

[update: In .Net framework 2.0, you can use System.Threading.Thread.ManagedThreadId to get a numeric thread id.]