Python thread

Terry Reedy tjreedy at udel.edu
Thu Sep 1 17:54:37 EDT 2011


On 9/1/2011 5:14 PM, George wrote:
> Hi,
> Why doesn't python threads show an associated PID?  On spawning python
> threads using the threading module I can only see the main thread's pid on
> using top or ps unix command, no  subprocesses are displayed. In otherwords
> top or ps in not aware of any subprocesses created using threading module in
> python.

Perhaps because threads are not subprocesses?

> Whereas in Java , creating threads will result in separate pid , these
> subprocesses can be listed using top or ps. Java threads get mapped to the
> cores in the system.
>
> Does it mean that python threads are not mapped to the core in the system.

They all run on the same core.

> On using multiprocessing module, separate processes are created with unique
> PID.

That is why multiprocessing was added.


-- 
Terry Jan Reedy




More information about the Python-list mailing list