pid : 2394 tid : 2399
pid : 2394 tid : 2398
pid : 2394 tid : 2397
pid : 2394 tid : 2395
*this is using getpid() __NR_gettid*
pid :2529 tid : 1811777280
pid :2529 tid : 1820169984
pid :2529 tid : 1828562688
pid :2529 tid : 1836955392
pid :2529 tid : 1845348096
*this is using pthread_self()*
I am using Fedora17.
I was wondering why tid result differ between getpid() and pthread_self()?
which one is right? my prof. said pthread uses posix not linux system.
and in multi thread condition pid is same? am i got right result?
gettidreturns thread ID andpthread_selfreturns POSIX thread ID. Both differs.This is the default behavior. See the linux man page of
pthread_self(). These 3 clauses will clarify it.Also this from
gettidman page