Skip to contentSkip to conversation

help

DISCUSSION Limeng [李萌] 3 participants 3 messages Aug 29, 2006

lore
Share & tools
lore
#0 lore raw

Hi,
How can I get one thread’s LWP id on linux?
The thread is not the main thread, so that getpid() does not work. And the LWP id is not the same as the result by pthread_self().

Any suggestion?

Xixi
2006-8-29

#1 lore raw

[OT] thread identification (was: help)

Quoted 1 line · Limeng [??????]

How can I get one thread???s LWP id on linux???

See gettid(2).

Quoted 5 lines

The thread is not the main thread, so that getpid() does not work. And the LWP id is not the same as the result by pthread_self().

Any suggestion?

Don't ask it over here, this list is about kernel development, not about pthread questions.

Erik

Signature · 2 lines
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands
#2 lore raw
In reply to Limeng [李萌]
Quoted 6 lines

Hi,
How can I get one thread’s LWP id on linux?
The thread is not the main thread, so that getpid() does not work.
And the LWP id is not the same as the result by pthread_self().

Any suggestion?

gettid(), I assume.

Jan Engelhardt