[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Interprocess lua_State* sharing question
- From: "Keith Pimmel" <pimmel@...>
- Date: Mon, 12 May 2008 13:48:34 -0500
Something tells me I'm making this harder than I need to, but I wanted to
make sure I'm not doing something stupid. I welcome any and all thoughts on
possibly turning this design approach on its head.
I'm working in MATLAB/Simulink and its compiled sister, RealTime
Workshop (RTW). I have
created blocks (effectively DLLs) in Simulink that contain an embedded Lua
engine. I really only want a single Lua state for the whole simulation, but
each block family in Simulink creates its own state. However, when I
compile the whole sim using RTW (because everything is inlined) I get my
desired outcome of a single Lua state.
To get around the Simulink issue, I decided to proxy the Lua state via a
simple DLL, but then ran into the issue that despite having a common
code base, each invocation of a DLL has its own execution memory stack.
So that led me to trying some interprocess gorp, and I stumbled upon Boost's
interprocess shared memory capabilities. However, the problem I have now is
that I don't see a way to generate a Lua_state* in a particular memory
location, so I'm running into that road block now.
Anyone have thoughts or suggestions?
All help appreciated; thanks!
--
Keith Pimmel