hi
I know that pthread_create(tid....) call assigns a unique thread id which is stored in tid field by default, you can specify your own thread id using first parameter of pthread_create
cheng long <kevinclcn@xxxxxxxxx> wrote:
Hi, Arun
> I "guess" the 'pid' field of task_struct would be returned, as
> pthread_self() by definition returns the calling thread's ID which in the
> kernel should be the thread's pid.Somebody please CMIIW.
Since "printf("thread id: %u\n", pthread_id())" will generate a very
larger number than
"printf("process id: %u\n", getpid() )", so I don't think
pthread_self() will return the pid field of it's task_struct.
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/
Yahoo! India Answers: Share what you know. Learn something new. Click here
Send instant messages to your online friends - NOW