lua-users home
lua-l archive

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

Fun, fun, fun:) I figured it would take a pair of SJ/LJ per context switch
and that was about it. 512 bytes to be copied per switch on Win32. Somehow I
don't think non-preservation of locals is a big deal.I might try to run this
puppy one of these days just for the fun of it.

Thanks a lot,


----- Original Message -----
From: "Björn De Meyer" <>
To: "Multiple recipients of list" <>
Sent: Saturday, June 08, 2002 1:29 PM
Subject: Re: Fiber thing?

For more on setjmp/longjmp fibers
please look at the following page:

It describes a scheduler written in ANSI C using only
setjmp and longjmp. It has one major deficiency,
that is, it does not copy the stack. So you cannot use
non-static local variables in the functions that are
running in parallel as coroutines/fibers.

But, perhaps it is possible to perform this feat with
just plain ANSI C. Is anyone here courageous enough to try?

"No one knows true heroes, for they speak not of their greatness." --
Daniel Remar.
Björn De Meyer