Learn R Programming

memshare (version 1.1.0)

registerVariables: Function to register variables in a shared memory space.

Description

Given a namespace identifier (identifies the shared memory space to register to), this function allows you to allocate shared memory and copy data into it for other R sessions to access it.

Usage

registerVariables(namespace, variableList)

Value

No return value, called for allocation of memory pages.

Arguments

namespace

string of the identifier of the shared memory context.

variableList

A named list of variables to register. Currently supported are matrices and vectors.

Author

Julian Maerte

See Also

releaseVariables, retrieveViews

Examples

Run this code
  library(memshare)
  n = 10
  m = 10

  TargetMat= matrix(rnorm(n * m), n, m) # target matrix
  x_vec = rnorm(n) # some other vector

  namespace = "ns_register"
  registerVariables(namespace, list(TargetMat=TargetMat, x_vec=x_vec))
  memshare::releaseVariables(namespace, c("TargetMat", "x_vec"))

Run the code above in your browser using DataLab