[asterisk-dev] Asterisk vs system thread IDs

Tilghman Lesher tilghman at meg.abyt.es
Tue Feb 15 01:48:14 CST 2011


On Tuesday 15 February 2011 01:03:28 Kirill Katsnelson wrote:
> On 110214 1915, Tilghman Lesher wrote:
> > On Monday 14 February 2011 18:50:54 Kirill Katsnelson wrote:
> >> `core show locks' and `core show threads' print 64-bit threads IDs,
> >> the system uses 16-bit ones. Is there a way to map one to another?
> >> 
> >> Linux 2.6.28 x86_64 here.
> > 
> > /usr/include/bits/pthreadtypes.h says that the pthread_t type is an
> > unsigned long int.  What weird x86_64 system are you running where a
> > long integer is only 16-bits wide?
> 
> Ubuntu Server 9 jaunty, kernel 2.6.28.
> 
> Maybe I was wrong with the assumption they are 16 bit; they just never
> exceeded 16 bits in range in my experience. Let's say they are just two
> ways to identify threads. I am talking about numbers shown
> 
> a) by top -H -p `cat /var/run/asterisk.pid`
> b) by gdb `info threads', second column.
> c) the number shown by gdb as the mutex owner.
> 
> These are integers in the range of hundreds to slighlty above 30000, but
> that observation is unimportant here.
> 
> This versus the long numbers like 0x7fc919a4f950, shown by `core show
> locks' and `core show threads'. I do not know how to match these to
> threads in gdb.

That's a question you need to ask of the gdb developers, then.  All we are
doing is printing the literal return value of pthread_self().

-- 
Tilghman



More information about the asterisk-dev mailing list