process
fork
forks a second execution path
Calling Sequence
Description
fork()
Important: The process package has been deprecated. Use the superseding package Threads instead.
The fork command splits execution of the Maple process. A second copy of the Maple kernel begins to run, and both copies continue executing in the same place.
The fork command returns the system process ID of the new process in the parent process, and returns 0 in the child process.
Both processes continue with an initially identical state, but subsequent changes of state in either process are unique to that process (that is, variables are not shared).
The child process does not have access to the parent's output display. Therefore, printing from the child will not display any results.
If the fork operation fails, fork generates an error.
The fork function is only available on platforms that support true concurrent processing (for example, UNIX).
WARNING: Do not call fork at the top level (that is, at the prompt, or as a top level statement in a file being read). Doing so results in two Maple processes, both of which compete for subsequent input. Likewise, make sure that no forked process ever returns to the top level.
See Also
process(deprecated)[exec]
process(deprecated)[kill]
process(deprecated)[launch]
process(deprecated)[pipe]
process(deprecated)[wait]
Threads
Download Help Document