Anyone know the difference between the thread handle that's returned by CreateThread and the thread ID?
thanks.
CreateThread
Started by coolgroupsdotcom, Sep 22 2005 10:16 AM
2 replies to this topic
#1
Posted 22 September 2005 - 10:16 AM
#2
Posted 22 September 2005 - 11:57 AM
The difference is that there can be multiple handles to the same object (in this case a thread). While each thread has a unique identifier.
- TripleBuffer
- Me blog
- Me blog
#3
Posted 23 September 2005 - 06:12 AM
Handle is usually obtained when something is opened, thus later we can perform additional operation using handle with functions that requires handle as parameter, also what is opened it should be closed, in CreateThread case thread should be terminated. But there is also OpenThread function that opens existing thread, and then when we end with that thread, a handle should be closed.
Identifer itself provides less functionality, because when we have it, it doesnt provides additional access to object.
Usually handle is an address in memory and identifier is an index in some array, thus actual value for identifiers vary in rather small values.
Identifer itself provides less functionality, because when we have it, it doesnt provides additional access to object.
Usually handle is an address in memory and identifier is an index in some array, thus actual value for identifiers vary in rather small values.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












