[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Fiber thing?
- From: "Alex Bilyk" <nebula-crl-2688@...>
- Date: Sat, 8 Jun 2002 23:11:37 -0700
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,
AB
----- Original Message -----
From: "Björn De Meyer" <bjorn.demeyer@pandora.be>
To: "Multiple recipients of list" <lua-l@tecgraf.puc-rio.br>
Sent: Saturday, June 08, 2002 1:29 PM
Subject: Re: Fiber thing?
For more on setjmp/longjmp fibers
please look at the following page:
http://www.csl.mtu.edu/cs4411.ck/www/NOTES/non-local-goto/mtp.html
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
bjorn.demeyer@pandora.be