basic thread question

Piet van Oostrum piet at cs.uu.nl
Mon Aug 24 10:41:58 CEST 2009


>>>>> Dennis Lee Bieber <wlfraed at ix.netcom.com> (DLB) wrote:

>DLB> On Sun, 23 Aug 2009 22:14:17 -0700, John Nagle <nagle at animats.com>
>DLB> declaimed the following in gmane.comp.python.general:

>>> Multiple Python processes can run concurrently, but each process
>>> has a copy of the entire Python system, so the memory and cache footprints are
>>> far larger than for multiple threads.
>>> 
>DLB> 	One would think a smart enough OS would be able to share the
>DLB> executable (interpreter) code, and only create a new stack/heap
>DLB> allocation for data.

Of course they do, but a significant portion of a Python system consists
of imported modules and these are data as far as the OS is concerned.
Only the modules written in C which are loaded as DLL's (shared libs)
and of course the interpreter executable will be shared.
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: piet at vanoostrum.org



More information about the Python-list mailing list