Start a new child process.
In Linux, the usual combination of
is used to spawn a new child process. Standard streams are redirected
over regular unnamed
In Windows a new process is spawned with
streams are redirected over unnamed pipes obtained with
CreatePipe(). However, because non-blocking (overlapped
in Windows-speak) read/write is not supported for unnamed pipes,
two reader threads are created for each new child process. These
threads never touch memory allocated by R and thus they will not
interfere with R interpreter's memory management (garbage collection).
is_process_handle() verifies that an object is a
valid process handle as returned by
process_kill(handle) deliver the signal to the child
process pointed to by
handle and all of its descendants.
deliver the signal only to the child process pointed to by
handle but to none of its descendants.
1 2 3 4 5 6 7 8 9 10 11
Path to the executable.
Optional arguments for the program.
Optional new working directory.
Object to be printed or tested.
Other parameters passed to the
command is always prepended to
arguments so that the
child process can correcty recognize the name of its executable
argv vector. This is done automatically by
environment can be passed as a
character vector whose
elements take the form
"NAME=VALUE", a named
vector or a named
workdir is the path to the directory where the new process is
ought to be started.
"" mean that working
directory is inherited from the parent.
spawn_process() returns an object of the
process handle class.
termination_mode specifies what should happen when
process_kill() is called on a
subprocess. If it is set to
TERMINATION_GROUP, then the
termination signal is sent to the parent and all its descendants
(sub-processes). If termination mode is set to
TERMINATION_CHILD_ONLY, only the child process spawned
directly from the R session receives the signal.
In Windows this is implemented with the job API, namely
TerminateJobObject(). In Linux, the child calls
fork() but before
called with the negate process id.
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.