basic thread question

Piet van Oostrum piet at cs.uu.nl
Mon Aug 24 07:21:03 EDT 2009


>>>>> Dave Angel <davea at ieee.org> (DA) wrote:

>DA> Dennis Lee Bieber wrote:
>>> On Sun, 23 Aug 2009 22:14:17 -0700, John Nagle <nagle at animats.com>
>>> 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.
>>>> 
>>>> 
>>> One would think a smart enough OS would be able to share the
>>> executable (interpreter) code, and only create a new stack/heap
>>> allocation for data.
>>> 
>DA> That's what fork is all about.  (See os.fork(), available on most
>DA> Unix/Linux)  The two processes start out sharing their state, and only the
>DA> things subsequently written need separate swap space.

But os.fork() is not available on Windows. And I guess refcounts et al.
will soon destroy the sharing.
-- 
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