Skip to contentSkip to conversation

How to get thread ID(LWP) in program ?

DISCUSSION Gaurav Bhatnagar 1 participant 1 message Jun 20, 2007

lore
Share & tools
lore
#0 lore raw

Hi,

I have a program that creats a number of threads using pthread_create function. When I use "ps -eLf" command I see a column LWP i.e. (threadID) of all newly created process. I want to print these LWP from my program in thread routines of each thread to see which LWP belongs to which thread.

Please tell me what function should i use to print LWP of threads.

Thanks in advance.

Regards,
Gaurav
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs