[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Sharing variables/values between multiple interpreters/states
- From: Andy Tai <andy@...>
- Date: Fri, 16 Jun 2000 19:50:16 -0700
Hi, I am using Lua 4.0 alpha as the extension language to one of my C
programs. The program is multithreaded, and each thread has one Lua
interpreter (one lua_State object). This setup allows each thread to
execute Lua statements concurrently. However, I would like to share some
Lua variables or tables across multiple interpreters (i.e., some variables
have the same values when accessed from these interpreters, and changes in
one thread to values of such variables are visible to other threads). Is
this possible, and if so, what's the best way to implement it from C
(assuming I will do locking also at the C level so critical sections are
protected)? Thanks for any suggestion.