Get thread pid

ma mabdelkader at gmail.com
Fri Jan 30 11:17:55 EST 2009


Actually, the command given "ps axH" uses H which shows threads as if they
were processes. If you check the pid of these "processes," you would find
that they are all equivalent.


On Fri, Jan 30, 2009 at 9:56 AM, Alejandro <alejandro.weinstein at gmail.com>wrote:

> On Jan 30, 4:00 am, Ove Svensson <ove.svens... at jeppesen.com> wrote:
> > Pidis a process identifier. Threads are not processes. All your threads
> > execute within the context if a single process, hence they should have
> > the samepid. Threads may have athreadid but it is not the same as thepid.
>
> According to this document (http://heather.cs.ucdavis.edu/~matloff/
> Python/PyThreads.pdf<http://heather.cs.ucdavis.edu/%7Ematloff/Python/PyThreads.pdf>),
> at least in Linux, threads are process:
>
> "Here each thread really is a process, and for example will show up on
> Unix systems when one runs the appropriate ps process-list command,
> say ps axH. The threads manager is then the OS."
>
> If you look at my original post, pstree does show different PIDs for
> the threads.
>
> Regards,
> Alejandro.
>
>
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090130/2a428f4c/attachment.html>


More information about the Python-list mailing list