lua-users home
lua-l archive

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


As mentioned, there has been previous discussions about this subject 
in the past. There is basicly 2 approaches to the problem. 

The first one is making lua stackless (i.e: non-recursive on lua->lua 
calls) which works nice but involves some changes within the Lua 
source code to accomplish. It's a little more work but it's cross-

The second option is to use a coroutine (sort of like threads) based 
system from which you can interrupt lua's execution with special 
commands like "Sleep" or "Suspend". Depending on the needs, this 
implementation can be coded with no (or very little) modifications to 
lua. Unfortunateley, since in implies creating threads, it tends to 
be platform dependant (i'v posted snippits from my implementation a 
few days ago and it does require 1 line of inline assembly code to 
change the CPU stack pointer).

Also, as for searching through the archives, i'm subscribed to the 
mailing list through which allows searches through 
the mailing list... This way it might be easier for you to locate 
specific threads.

Hope i was of any help,
  Sebastien St-Laurent

> Hi there I'm looking into using Lua in an application and have a 
> Is it possible to stop processing a lua state and continue on from 
> point later? For instance during a single frame we want to process 
a bunch
> of lua commands then continue with our regular c code and come back 
to where
> we left off next frame.  Is there anyway to do this?  I haven't had 
a chance
> to wade through all the documentation/ code yet so any help would be
> appreciated.
> Thanks
> Andrew Paton
> andrew@s...