lua-users home
lua-l archive

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

It's perfectly possible to do this with lua_newthread if you need a
shared global space or simply lua_open if each has its own global
space.  Just give each script its own lua_State and you'll be set.


On Feb 13, 2008 12:52 PM, M M <> wrote:
> I'd like to embed LUA in my C++ program.  But I'd like to run _multiple_
> scripts simultaneously in the same process in a single thread and I'd like
> complete control over them.  For example:
>   while (running) {
>     StepScript1();
>     do_stuff();
>     StepScript2();
>     do_more_stuff();
>     StepScript3();
>     StepScript4();
>     ...
>   }
> I've read a bit about the coroutine and yield stuff, but I'd rather be able
> to step my scripts without relying on them to yield.
> Any thoughts on if this is possible with or without modifications to the LUA
> runtime?
> Thanks,
> Mike