fork - create a child process of SLI
fork -> PID
1. fork
(Well, just kidding...)
2. fork 0 eq {(I'm the child!) = quit} {(I'm the parent!) =} ifelse
Try this several times. You will notice the child message to appear
before or after the parent message "by chance". (Even after the
parent's SLI-prompt...)
Thin wrapper to the fork() system function
In : -none-
Out: PID(integer) : 0 (for the child)
the child's process ID (for the parent)
-
A full parallel process of SLI is forked.
Parent and child will execute in parallel. There is no way to know
which will start being executed first.
Child inherits all open files, including stdin and stdout, from parent!
Thus, calling fork interactively from the SLI-prompt will result in
command-line-confusion if both processes end up without quitting.
If fork() cannot be executed, an error is raised.
SLI-function spoon (processes.sli) is a more convenient wrapper
to fork!
R Kupper
Mar 17 1999
/var/www/debian/nest/nest-simulator-2.20.0/sli/processes.h