lua-users home
lua-l archive

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


> My primary problem with LUA as it seems right now is that I'd like to
> use it in a multi-threaded way, based on OS-supported threads. I assume
> all it would take to do this is to collect all the globals used by LUA
> (ie, its C-language implementation globals - not the LUA globals) into a
> structure which can then be "instantiated" to get a new, fresh LUA
> interpreter which I then can stick into a thread and run on its own. I
> brought this up a while back on this mailing list, and that seemed to be
> the general consensus as I recall.

I'd like to multi-thread Lua too.  I was thinking of making a fallback 
that maps the undefined table called "thread" to a different table for 
each thread.  So one could write, thread.x, in any thread and get a private 
version or write, x, to get a global.  The problems I see with this 
scheme are some overhead and one needs to prevent threads from 
defining a global called "thread" (which I'm not sure how to do).

Any comments?

Russ Webb