Get thread pid

Alejandro alejandro.weinstein at gmail.com
Fri Jan 30 11:33:53 EST 2009


On Jan 30, 9:11 am, Jean-Paul Calderone <exar... at divmod.com> wrote:
> [clarification about threads]

Thank you for the clarification. I will reformulate my question:

pstree and also ntop (but not top) show a number for each thread, like
for instance:

$pstree -p 9197
python(9197)€ˆ€{python}(9555)
             †€{python}(9556)
             †€{python}(9557)
             †€{python}(9558)
             †€{python}(9559)
             †€{python}(9560)
             †€{python}(9561)
             †€{python}(9562)
             †€{python}(9563)
             „€{python}(9564)

Is is possible to get the number corresponding to each thread?

The reason I am interested is because one of my thread is hogging the
CPU, and want to find which one is the culprit.

Regards,
Alejandro.



More information about the Python-list mailing list