Multicore futures require an operating system that supports forked processing. Operating systems such as Unix and macOS supports forking, whereas Microsoft Windows does not.
supportsMulticore()
TRUE if forked processing is supported and not disabled, otherwise FALSE.
The Microsoft Windows operating system does not support processes forking. Unix-like operating system such as Linux and macOS support forking. For some R environments it is considered unsafe to perform parallel processing based on forking. For example, RStudio Inc. recommends against using forked processing when running R from within the RStudio software. Because of this, the future ecosystem disables forked processing by default when it detects it runs R from within RStudio despite running on a Unix-like operating system.
It is possible to disable forked processing for futures by setting R
option future.fork.enable
to FALSE
. Alternatively, one can
set environment variable R_FUTURE_FORK_ENABLE
to false
.
This will cause plan(multicore)
to work as plan(sequential)
,
and plan(multiprocess)
to work as plan(multisession)
.
Analogously, it is possible to override disabled forking by setting one
of these to TRUE
.