Enumerable missing fiber-related next, rewind, with_index methods
-----------------------------------------------------------------

                 Key: JRUBY-3435
                 URL: http://jira.codehaus.org/browse/JRUBY-3435
             Project: JRuby
          Issue Type: Bug
          Components: Ruby 1.9
            Reporter: Charles Oliver Nutter
            Assignee: Thomas E Enebo


Enumerable#next, rewind, and with_index may require some trickery to implement. 
In Ruby 1.9, they use a fiber behind the scenes. If we followed the same 
course, we would need to use a native thread for any enumerable executing this 
way, which could be prohibitively expensive. However we could also have 
special-cased logic for all the core classes, since the details of their 
enumeration logic are known to us. So for e.g. array, we could simply store a 
position in the Enumerable state or current thread that is array index-aware. 
So for many cases we would not need the fiber/thread functionality.

We would need to still detect whether e.g. Array#each has been overridden, so 
we know to fall back on the slower mechanism. And when we do need to use 
threading, we should certainly be pooling as much as possible to avoid spinning 
up a new native thread every time.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

    http://xircles.codehaus.org/manage_email


Reply via email to