lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi Andreas,

On Sat, Nov 30, 2002 at 09:31:13AM +0100, Andreas Rozek wrote:
> I'm currently checking inhowfar LuaJava is "thread-safe" (it
> must be - otherwise it would be impossible to script graphi-
> cal user interfaces).

regardless of whether LuaJava is thread-safe, Lua 4.0 itself is
not. So, even if LuaJava were meade thread-safe now, you still could
not accomplish what you want to do with the current stable version of
Lua.

In addition, even if you tried to use Lua 5.0 alpha, there would still
be the following stumbling blocks in LuaJava itself:

1. it uses the lua3 compatibility layer, and hence uses a global lua
state.

2. it uses a global hash table to cache proxy objects, without regards
to what lua state they belong to.

There may be other things that I did not think of yet, but the bottom
line is that making LuaJava thread-safe will be a major task, and is
impossible at all with Lua 4.0.

You *can*, however, use multiple Java threads, as long as you take
care that LuaJava has interactions with only a single thread, which
always must be the same one.

- Christian