A multiprocess future is a future that uses multicore evaluation if supported, otherwise it uses multisession evaluation. Regardless, its value is computed and resolved in parallel in another process.

WARNING: Consider the 'multiprocess' future plan deprecated. Instead, explicitly specify 'multisession' or 'multicore'. The former works everywhere and is the recommended one between the two. Forked processing, which 'multicore' uses, is unstable in various environment and setups. The 'multiprocess' alias is therefore being phased out.

multiprocess(..., workers = availableCores(), envir = parent.frame())



Additional arguments passed to Future().


A positive numeric scalar or a function specifying the maximum number of parallel futures that can be active at the same time before blocking. If a function, it is called without arguments when the future is created and its value is used to configure the workers. The function should return a numeric scalar.


The environment from where global objects should be identified.


A MultiprocessFuture implemented as either a MulticoreFuture or a MultisessionFuture.

See also

Internally multicore() and multisession() are used.


# \donttest{

## Use multiprocess futures
#> Warning: Strategy 'multiprocess' is deprecated in future (>= 1.20.0) [2020-10-30]. Instead, explicitly specify either 'multisession' (recommended) or 'multicore'. In the current R session, 'multiprocess' equals 'multicore'.

## A global variable
a <- 0

## Create future (explicitly)
f <- future({
  b <- 3
  c <- 2
  a * b * c

## A multiprocess future is evaluated in a separate R process.
## Changing the value of a global variable will not affect
## the result of the future.
a <- 7
#> [1] 7

v <- value(f)
#> [1] 0
stopifnot(v == 0)

## Explicitly close multisession workers, if they were used
# }