File: /projects/sage/sage-7.3/local/lib/python2.7/site-packages/smc_sagews/sage_salvus.py
Signature : fork()
Docstring :
The %fork block decorator evaluates its code in a forked subprocess
that does not block the main process.
You may still use the @fork function decorator from Sage, as usual,
to run a function in a subprocess. Type "sage.all.fork?" to see
the help for the @fork decorator.
WARNING: This is highly experimental and possibly flaky. Use with
caution.
All (picklelable) global variables that are set in the forked
subprocess are set in the parent when the forked subprocess
terminates. However, the forked subprocess has no other side
effects, except what it might do to file handles and the
filesystem.
To see currently running forked subprocesses, type fork.children(),
which returns a dictionary {pid:execute_uuid}. To kill a given
subprocess and stop the cell waiting for input, type
fork.kill(pid). This is currently the only way to stop code
running in %fork cells.
TODO/WARNING: The subprocesses spawned by fork are not killed if
the parent process is killed first!
NOTE: All pexpect interfaces are reset in the child process.