Skip to content

Commit

Permalink
Added a bit of documentation on new (GNU R) package
Browse files Browse the repository at this point in the history
  • Loading branch information
akbertram committed Mar 28, 2017
1 parent 049a79d commit 8a2b772
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions source/index.rst
Expand Up @@ -13,6 +13,7 @@ Renjin Documentation
introduction
interactive/index
library/index
package/index
importing-java-classes-in-r-code
writing-renjin-extensions
renjin-java-api-specification.rst
Expand Down
23 changes: 22 additions & 1 deletion source/library/thread-safety.rst
@@ -1,7 +1,7 @@
.. _sec-thread-safety:

Thread-Safety
==========================
=============

R code must always be evaluated in the context of a Session, which carries certain
state, such as the Global Environment the list of loaded packages, global options, and the
Expand Down Expand Up @@ -70,3 +70,24 @@ pool Renjin ScriptEngine sessions.
.. _`Apache Commons Pool`: https://commons.apache.org/proper/commons-pool/
Sharing data between ScriptEngines
----------------------------------
One of the principal advantages of running multiple, concurrent R Sessions in the same process
is that you can share data between them.
By design, Renjin requires Vector implementations, which correspond to R objects of type "list", "character", "double", "integer",
"complex", and "raw", to be _immutable_, which means that they cannot be changed after they are created. Environment and
pairlist objects are _mutable_, both within the R language and in their Java implementations, and so _cannot_ be shared between
Sessions.
This means that a data.frame object, for example, can be created or loaded once, and then shared between multiple
concurrent Sessions which do their own computation on the dataset.

0 comments on commit 8a2b772

Please sign in to comment.