Re: Thread_Id

Arjan van de Ven
2005-07-14T12:26:00Z

> >
> So then what is the meaning of that typedef and why its still there ?

the typedef means that the *IMPLEMENTATION* uses an unsigned long to
store its cookie in.

>
> >Other implementations are allowed to use different types for this. In
> >fact, I'd be surprised if NPTL and LinuxThreads would have the same
> >type... (they'll have the same size for ABI compat reasons of course,
> >but type... not so sure).
> >
> >
> >
> I haven't faced the same returns with 2.4.18. So why is it so with 2.6.x
> kernels ? pthread_self() on 2.4.18 was returning the same as gettid()
> with 2.6.x.

pure luck. NPTL threading uses it to store a pointer to per thread info
structure; other threading (linuxthreads) may have stored a pid there to
identify the internal thread. nptl is 2.6 only so you might have
switched implementation of threading when you switched kernels.