fork()

Hrvoje Niksic hniksic at srce.hr
Mon Jun 7 18:06:43 CEST 1999


Arne Mueller <a.mueller at icrf.icnet.uk> writes:

> All that woks fine now (after I spend a long time fiddling with the
> pipe and select stuff to synchronize I/O). However the forking is a
> waste of time and memory because all the children get their own
> large dictionary!

If you don't change the dictionary, the memory will not be copied.
Most modern Unixes support COW (copy on write) which means that the
actual fork()ing does surprisingly little.  Only when the memory is
written to, a new copy is spawned off.

If the children are modifying the dictionary, that's well something
different...




More information about the Python-list mailing list