( ).
, .
pid_t gettid(void);
pthread_t pthread_self(void);
pid_t, pthread_t. , thread, , software entities. a thread id , . , pthread_t , pthread, pid_t , ( Linux, pid_t).
, . pthread_t , pthread_t pid_t , pid_t - , .
. pid_t ==, pthread_t , pthread_equal.
/ , pthread , . pthread , thread id pthread_t. thread entity, (, Linux pid_t, Windows - DWORD).
So, although the underlying implementation may vary from OS to OS, code written against abstraction pthreadremains portable across all OSs (as long as you are limited to abstraction pthread).
source
share