David Flanagan wrote: > Hi all, > > I've been following fibers with interest and just noticed that ko1 > modified things so that fibers work as semi-coroutines by default now. > If you just want to use resume and yield, there is no need to require > 'fiber'. (I hope the implication of this is that the JRuby team has > assured ko1 that they will be able to implement Fiber#resume and > Fiber::yield). > > To get the full power of co-routines, you need Fiber#transfer and for > that you must still require 'fiber'. This means, I think, that ko1 > judges it unsafe, and I would guess it also means that implemenations > like JRuby may not be able to support it... Correct on both counts. Of course, currently Fiber is implemented in JRuby using a thread, so it's heavier than one would like. It will not be possible to implement lightweight Fibers or Fiber#transfer without running a stackless bytecode engine, microthreading JRuby's compiler output and core class methods, or adding continuations to the JVM. None of these are likely to happen soon. - Charlie