From 725cb7ab49fd7c6386463aeb08b99931625224e8 Mon Sep 17 00:00:00 2001 From: James Roseborough Date: Fri, 5 Jul 2013 21:30:17 +0000 Subject: [PATCH] Add documentation on thread safety with luaj 3.0 --- README.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.html b/README.html index b0758103..864f0d8c 100644 --- a/README.html +++ b/README.html @@ -72,6 +72,7 @@ It also includes miscellaneous improvements over luaj 2.0.x:
  • Better debug reporting when using closures.
  • Line numbers in parse syntax tree.
  • More compatible table behavior. +
  • Better thread safety.

    Luaj 2.0.x

    Support for lua 5.1.x features, plus: @@ -381,6 +382,22 @@ and the math operations are limited to those supported by Java ME. All libraries are included except luajava, and the os, io, and math libraries are limited to those functions that can be supported on that platform. +

    Thread Safety

    + +Luaj 3.0 can be run in multiple threads, with the following restrictions: + + +For an example of loading allocating per-thread Globals and invoking scripts in +multiple threads see examples/jse/SampleMultiThreaded.java + +

    +As an alternative, the JSR-223 scripting interface can be used, and should always provide a separate Globals instance +per script engine instance by using a ThreadLocal internally.

    4 - Libraries

    @@ -392,6 +409,7 @@ See standard lua documentation for

    The following libraries are loaded by both JsePlatform.standardGlobals() and JmePlatform.standardGlobals():

    	base
    +	bit32
     	coroutine
     	io
     	math