Determining thread id on Linux

  • Thread starter =?ISO-8859-2?Q?Krist=F3f_Str=F3bl?=
  • Start date
?

=?ISO-8859-2?Q?Krist=F3f_Str=F3bl?=

Hi!

I'm working under RedHat Linux (Advanced Server 3.0, kernel 2.4) and would like to determine thread identifiers in my multithreaded application. The "ps -efm" shell command lists every thread id of my process, but I do not know how to get them from Python. os.getpid() returns the same number even if called from different threads. thread.get_ident() returns different numbers if called from different threads, but these numbers do not correspond to the thread ids seen by the OS.

Is there a way to get the thread ids from Python, or do I have to write a C extension module to get them?

Thanks,
Kristóf Stróbl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top