I am currently debugging an application which uses pthreads. When I attach GDB
it continuously prints messages of this form:
[New Thread a_hex_number (LWP a_dec_number)]
I assume that a_hex_number is an address, but whose address it is?
I assume a_dec_number is a unique identifier for created thread, is it?
Are my assumptions right?
Can anyone give me more detail about the numbers and their meaning?
I already read this document but I am still having trouble to get the full picture.
Probably an info about the Linux systags would help me a lot.
It’s the address of a thread descriptor (on Linux also the result of
pthread_self()call).No, it’s the thread-id assigned by the kernel to this thread. It’s the same thing as visible in
psoutput (on Linux,clone(2)threads and processes have very few differences at the kernel level).