windows - Thread ID vs. Thread Handle -


an embarrassing question: difference between thread id , thread handle? why both needed? there difference between windows , linux?

linux's pthread library not, far know, have concept of thread handle. pthread_create , other pthreads functions, return thread id.

under windows, thread handle different thread id, in same way file handle different file name.

the thread handle token allows thread (typically wait or kill it). win32 has these tokens lots of objects, , calls them handle in general.

the token pointer @ running (or stopped) thread , has set of abilities associated it, example, can have handle permits wait for, not kill, thread. in same way, can have file handle read-only.

this level of indirection may or may not useful, it's way win32 it, , it's broadly consistent how handles other types of objects.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -