lua-users home
lua-l archive

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


Is it possible to use the lua dictionary mechanism to keep a data
space that is separate from the global variables in lua?  I would like
to create a separate variable namespace that is accessible from
several currently running lua threads.  To do this, I wanted to create
a new kind of lua_tag that would have the settable/gettable redefined
to retrieve the objects from this new table, so that many lua instances
could retrieve this data from the same namespace.

I was thinking of creating a separate lua interpreter instance that would
be for just storing global variables, and then I would just use a 
semaphore to block so that only one other thread could access it at once.
But then I have to duplicate the variable instance to prevent lua_Objects
from this instance to being passed back to other threads, which would
no longer synchronize on the semaphore used to prevent concurrent access.

Maybe this will just have to wait for a multithreaded lua. ?

Dan

Dan Marks
dmarks@uiuc.edu