% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fork.R
\name{isProcessForkedChild}
\alias{isProcessForkedChild}
\title{Is the Current Process a Forked Child?}
\usage{
isProcessForkedChild()
}
\value{
A length-one logical.
}
\description{
Returns \code{TRUE} if the current process is a \code{fork()} of the process in which
RcppParallel was originally loaded.
}
\details{
Intel TBB — the parallel backend used by \code{parallelFor()} and
\code{parallelReduce()} — does not support being used in a child process after
\code{fork()}. Packages that may be invoked from within \code{parallel::mclapply()}
or similar fork-based parallelism should call \code{isProcessForkedChild()} and
fall back to a serial code path when it returns \code{TRUE}.

On Windows, which has no \code{fork()}, this always returns \code{FALSE}.
}
\examples{
\dontrun{
library(RcppParallel)
isProcessForkedChild()
parallel::mclapply(1:2, function(i) RcppParallel::isProcessForkedChild())
}

}
