In linux c program, how to print thread id of a thread created by pthread library? for ex: we can get pid of a process by getpid()
getpid()
You can use pthread_self()
pthread_self()
The parent gets to know the thread id after the pthread_create() is executed sucessfully, but while executing the thread if we want to access the thread id we have to use the function pthread_self().
pthread_create()