[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Newbie: Cooperative Multitasking
- From: Derek Wong <derekw@...>
- Date: Wed, 3 Nov 1999 22:27:51 -0800 (PST)
I see the problem, I was reading the archives from the lua ftp site, file
lua-l-archive.gz. I guess in that archive they did delete that
post...thanks for the pointer to the post on the web site. I guess I'll
start digging into the lua interpreter code and see what I can come up
Any pointers on where I should try to start/stop the scripts? Should it be
at the level of the virtual machine, maybe make a new opcode or some kind
of flag that gets checked? Or should it be higher up like in the function
luaD_protectedrun? Or is it somewhere in between?
On Thu, 4 Nov 1999, Bret Mogilefsky wrote:
> On Thu, Nov 04, 1999 at 12:26:41AM -0200, Derek Wong wrote:
> > I was wondering if someone might
> > offer me some advice at implementing cooperative multitasking with
> > lua scripts. I'm an amateur programmer so please excuse me if I've
> > used the wrong terminology.
> > C program runs along and starts a Lua script...
> > Lua script does some stuff and then executes a pause() command
> > expecting the C program to resume at that point when it's ready...
> > C program goes along doing other stuff and then at some point
> > along the way will check if there are any Lua scripts waiting
> > to be resumed, if there are it will resume their execution at
> > where they left off...
> You'll want to read back through the mailing list archives... Start on the
> thread "Game oriented usage of Lua?", which you can find here:
> At one point in that thread I wrote a LARGE description of how I used Lua in
> Grim Fandango when I was at LucasArts, as well as how I modified the
> interpreter to support cooperative threading. I was afraid of getting fired
> for divulging details at the time, so I agreed to post on the condition that
> it not be included in the archive... However, this is exactly the post you
> need! Oh wait, never mind. Good thing I already have another job... Here's
> the post:
> I don't have time to read back through the whole thread right this second to
> see if I gave details on the gotchas in threading up the interpreter, but I
> can give you a thumbnail sketch of how to do it.
> Nice to be back on the list...
> "Why, that's the second biggest monkey head I've ever seen!" --Guybrush
> "LeChuck's dead. I blew him into a million gooey pieces." --Guybrush
> Bret Mogilefsky ** mogul at ay see em dot org ** Programmer, SCEA R&D