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

Staff online

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top