Low-level Functions for Management of Forked Processes
These are low-level support functions for the forking approach.
They are not available on Windows, and not exported from the namespace.
1 2 3 4 5 6 7 8
if omitted, all active children are returned, otherwise
child process (object of the class
timeout (in seconds, fractions supported) to wait for a response before giving up.
list of child processes or a single child process
object or a vector of process IDs or
process (object of the class
integer: signal to send. Values of 2 (SIGINT), 9
(SIGKILL) and 15 (SIGTERM) are pretty much portable, but for maximal
children returns currently active children.
readChild reads data from a given child process.
selectChildren checks children for available data.
readChildren checks all children for available data and reads
from the first child that has available data.
sendChildStdin sends a string (or data) to one or more child's
standard input. Note that if the master session was interactive, it
will also be echoed on the standard output of the master process
(unless disabled). The function is vector-compatible, so you can
child as a list or a vector of process IDs.
sendMaster sends data from the child to the master process.
mckill sends a signal to a child process: it is equivalent to
pskill in package tools.
children returns a (possibly empty) list of objects of class
"process", the process ID.
readChildren return a raw vector with a
"pid" attribute if data were available, an integer vector of
length one with the process ID if a child terminated or
if the child no longer exists (no children at all for
TRUE is the timeout was reached,
FALSE if an error occurred (e.g., if the master process was
interrupted) or an integer vector of process IDs with children that
have data available, or
NULL if there are no children.
sendChildStdin returns a vector of
TRUE values (one for
each member of
child) or throws an error.
TRUE or throws an error.
This is a very low-level API for expert use only.
Simon Urbanek and R Core.
Derived from the \CRANpkgmulticore package.
1 2 3 4 5 6