The Managed Thread class does not expose any thread ID property neither any
handle property which one can use. However, the GetHashCode can be used to
uniquely identify a thread. Here's some more info on this:
http://msdn.microsoft.com/library/de...oftwindows.asp
But ofcourse, thats not going to help you since there's no method in the
managed thread class of retrieving the Thread object from the hashcode (or
even from the threadid or thread handle) unless you store the
hashcode-thread pairs in a hashtable which defeats the whole purpose of
lightweight!
In anycase I don't think hanging onto a thread object is that 'heavy' as
such. Compared to some of the GDI+ objects, these are pretty ligthweight and
shouldn't be much of a problem.
hope this helps..
Imran.
"Lucas Tam" <RE********@rogers.com> wrote in message
news:Xn***************************@140.99.99.130.. .
Hi all,
I'm currently storing a reference to the entire thread object in my
application. However, I'm wondering if there is a smaller object I can
point to such as an Integer ThreadID?
If there is such a thing as a ThreadID, is there a method I can use to
return the Thread object?
Thanks.
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/