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

View source: R/registerVariables.R

registerVariablesR Documentation

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)

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.

Value

No return value, called for allocation of memory pages.

Author(s)

Julian Maerte

See Also

releaseVariables, retrieveViews

Examples

  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"))

memshare documentation built on Dec. 5, 2025, 9:07 a.m.