On Sat, Feb 21, 2009 at 12:45 AM, gtim...@gmail.com
<gtim...@gmail.com> wrote:
> Is there any possibilities to allow AS3 to pause/resume the execution
> oz the Lua VM?I am trying to write a programming game (something like
You need to sandbox user's code. There was a recent thread here on this topic:
http://groups.google.com/group/lua-alchemy-dev/browse_thread/thread/ad662b451320b83b
In short: most of what you need can be done in pure Lua (google for
"Lua sandboxing"). If you need advanced functionality, we would be
glad to add it.
If you have further questions, please do not hesitate to ask.
Alexander.
Instruction count hook is possible only with Lua C API which is
currently unavailable to Lua Alchemy user's AS3 code.
I think we may expose something like
lua_alchemy.DoStringLimitInstructionsCount(code, num_instructions)...
This would require some extra though though... Please say if you need
this.
See also:
http://lua-users.org/wiki/NonBlockingLuaExecution
Alexander.
If possible, please keep us informed with your progress. This subject
is quite interesting.
> A new API like lua_alchemy.DoStringLimitInstructionsCount(code,
> num_instructions) will be useful for sure, especially when AS3 itself
> is not multi-threaded. I would recommend to add this regardless
> whether the pure Lua solution works or not.
I added an issue to the tracker.
Alexander.
Thank you for your report!
> I have the working library and sample code ready. I could upload them
> if needed.
I'm interested in looking at your library. Would you please upload it?
Perhaps as a github project?
Alexander.
> Done. the project name is "lua-process".
Thanks!
For the record, the url is http://github.com/gtimworks/lua-process/
I didn't knew that it is actually possible to set instruction count
hook from the plain Lua. That is a nice trick!
Alexander.