I've committed really basic Fiber support on trunk. It passes the simple tests from YARV's test_fiber (also committed, with bits commented out), and appears to run all demo code I've found online. The following parts aren't implemented yet:

- all error-handling
- Fiber.transfer (I wasn't clear how this is supposed to work, but it will probably be simple to do)

Also, two tests in test_fiber that construct a thousand or more fibers are commented out, because my implementation uses native threads (and the 10000-fiber test never seemed to return). This isn't to say it's not possible to support that many fibers with this impl, but it won't be cheap.

Anyway, have a look at the code. I've asked for clarification or a pointer to Fiber spec docs on ruby-core list...we can fill out the rest of the behavior then.

http://svn.codehaus.org/jruby/trunk/jruby/src/org/jruby/libraries/FiberLibrary.java
http://svn.codehaus.org/jruby/trunk/jruby/test/externals/mri/ruby/test_fiber.rb

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to