multiprocessing module backport from 3 to 2.7 - spawn feature

Andres Riancho andres.riancho at
Wed Jan 28 20:04:29 CET 2015

On Wed, Jan 28, 2015 at 3:06 PM, Skip Montanaro
<skip.montanaro at> wrote:
> On Wed, Jan 28, 2015 at 7:07 AM, Andres Riancho <andres.riancho at>
> wrote:
>> The feature I'm specially interested in is the ability to spawn
>> processes [1] instead of forking, which is not present in the 2.7
>> version of the module.
> Can you explain what you see as the difference between "spawn" and "fork" in
> this context?

Well, fork is a system call [0] where a process creates a copy of
itself, usually using COW [1]. This copy receives a new process ID and
is slightly dependent on the parent: they share the same address

Spawn, and I took that from the multiprocessing 3 documentation, will
create a new process without using fork(). This means that no memory
is shared between the MainProcess and the spawn'ed sub-process created
by multiprocessing.

My goal is to prevent dead-locks and other issues [2][3] which come
from forking a multithreaded program (situation I'm in right now).

[2] See "Note that safely forking a multithreaded process is
problematic." at

> Are you using Windows perhaps? I don't know anything obviously
> different between the two terms on Unix systems.

Nope, I'm on linux

> Skip

Andrés Riancho
Project Leader at w3af -
Web Application Attack and Audit Framework
Twitter: @w3af
GPG: 0x93C344F3

More information about the Python-list mailing list