Simple Thread Question

sismex01 at hebmex.com sismex01 at hebmex.com
Wed Oct 16 22:47:17 CEST 2002


> From: Steve Wilson [mailto:stevew at wolfram.com]
> 
> I'm currently using Python 2.2.1 on RedHat Linux 7.3 to run a 
> multi-threaded program.  I've noticed that instead of one 
> python process I have multiple python processes showing up
> in the process table(seen via top/ps).  Each process appears
> to have allocated the same amount of memory as the original
> python process, etc...  Should I see multiple interpreter 
> instances(processes) when running a threaded python program?  
> It almost looks as though the code has forked/execed once for
> each thread.  Should something else happen other than the
> ./configure, make, make install cycle to properly set up thread
> support?
> 
> Thanks in advance,
> 
> Steve
> stevew(at)wolfram.com
>

Linux Kernel 101. (again)

Linux manages threads in the same way it manages processes,
threads are like processes but with different creation flags
(check out the clone() syscall).

As such, they appear in the same process table, so you'll see
as many processes as you have threads running.

-gustavo




More information about the Python-list mailing list