-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathisProcessForkedChild.Rd
More file actions
32 lines (30 loc) · 998 Bytes
/
Copy pathisProcessForkedChild.Rd
File metadata and controls
32 lines (30 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
% 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())
}
}