On Wed, Oct 29, 2008 at 06:54:06PM +0900, r. schempp wrote: > Hi, > > In my master thesis I dealt with Continuations Based Web Servers and > tried to use continuations in Rails. This didn't go very well. I > expected continuations to work like I knew from their definition, but > they don't restore state in Ruby (1.8.6). They restore the state of the stack, not the state of the heap. This is the desired behavior. > Further the use of continuations is limited to the thread they are > created in. This seems to be caused by implementing continuations with > threads. Continuations are implemented with fibers on 1.9. They still cannot be called across threads. AFAIK changing this would be a huge undertaking, because saving the C stack in one thread and restoring it in another thread could result in objects being restored to a different place in memory than they were created, or even duplicated C objects on the stack that were not properly constructed/initialized. Paul