Jump to content


CreateThread


2 replies to this topic

#1 coolgroupsdotcom

    New Member

  • Members
  • PipPip
  • 16 posts

Posted 22 September 2005 - 10:16 AM

Anyone know the difference between the thread handle that's returned by CreateThread and the thread ID?

thanks.

#2 bladder

    DevMaster Staff

  • Moderators
  • 1057 posts

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.

#3 ikk

    Member

  • Members
  • PipPip
  • 87 posts

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users