page faults when spawning subprocesses
daniel.kabs at gmx.de
Wed Nov 9 13:17:03 CET 2005
Dave Kirby wrote:
> I am working on a network management program written in python that has
> multiple threads (typically 20+) spawning subprocesses which are used
> to communicate with other systems on the network. ...
Let me check if I got you right: You are using fork() inside a thread in
a multi-threaded environment. That sounds complicated. :-)
Have a look at
It mentions your use of fork, i.e. to create a new process running a
different program (in this case the call to fork() is soon followed by a
call to exec()).
If you fork in your multi-threaded environment, what happens with all
your threads? The document resorts to "the effects of calling functions
that require certain resources between the call to fork() and the call
to an exec function are undefined.". Maybe you are just experiencing
The document above recommends: "to avoid errors, the child process may
only execute async-signal-safe operations until such time as one of the
exec functions is called."
Maybe this discussion is also of some help:
More information about the Python-list