[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Cooperative Multitasking
- From: Peter Wang <tjaden@...>
- Date: Fri, 20 Oct 2000 11:48:35 +1100
Sebby <firstname.lastname@example.org> wrote:
> Well, that's the main problem. Lua runs it's VM in a recusrive way.
> Basicly, if you call a Lua, from within a Lua function, the VM will
> simply call itself recursivly. Now, one solution is to basicly back
> up the section of the system stack that was used in the task (along
> with the IP and some other info) and to restore it once the thread is
> brought back. This is an icky solution since you hav eto go backing
> up some registers and the system stack of the computer.
Could this be done using `setjmp'? Some Lisp implementations use it
to follow objects pointed to by the registers for garbage collection
purposes. Backing up the system stack is also surprisingly simple,
if not "clean". It might be a workable alternative to making the VM
email@example.com - http://www.psynet.net/tjaden/
BANDILE (BAN dyl), n. The thin red strip one pulls to release a Band-Aid.
-- Rich Hall, "Sniglets"