Any integral id of posix thread?

Vasily Postnicov shamaz.mazum at gmail.com
Sun Feb 7 06:43:35 PST 2016


Thank you, this is a very helpful answer. lwp_gettid() is exactly the thing
I need
7 февр. 2016 г. 16:52 пользователь "Imre Vadasz" <imre at vdsz.com> написал:

> On 16:12 Sun 07 Feb , Vasily Postnicov wrote:
> > Is there any way in pthread to get a unique descriptor of a thread like
> > pthread_self() but with an integer type? Like pthread_getthreadid_np()?
> If
> > no, I can send you a patch for it.
>
> There doesn't seem to be a pthread function available on DragonFly
> for this purpose yet.
> But you can use lwp_gettid() on DragonFly (from /usr/include/unistd.h),
> the lwpid_t return value is just an int.
>
> On DragonFly the thread id returned by lwp_gettid() is only unique within
> each process, not globally (whereas AFAIK the thread id, returned by
> FreeBSD's thr_self() or pthread_getthreadid_np() is globally unique in the
> system).
> So on DragonFly, to globally identify a specific thread in a specific
> process, you'd need both the pid (from getpid()), and the thread id (from
> lwp_gettid()).
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dragonflybsd.org/pipermail/users/attachments/20160207/d9eb22e2/attachment-0006.html>


More information about the Users mailing list