Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.7.0.pre1
    • Fix Version/s: JRuby 1.7.0.pre2
    • Component/s: Standard Library
    • Labels:
      None
    • Environment:
      Mac OSX 10.6.8, JDK 7
    • Testcase included:
      yes
    • Number of attachments :
      1

      Description

      While browsing through the MRI source, I noticed the following code regarding Etc.group iteration:

      etc.c
      static void
      each_group(void)
      {
          if (group_blocking) {
      	rb_raise(rb_eRuntimeError, "parallel group iteration");
          }
          group_blocking = (int)Qtrue;
          rb_ensure(group_iterate, 0, group_ensure, 0);
      }
      

      After running the attached test case, JRuby trunk goes into a high CPU loop. The C version prevents this by throwing a RuntimeError if you attempt a parallel loop. In essence the logic is:

      1. Check a group_blocking flag, and if it exists then throw a runtime error
      2. If it doesn't exist, set the flag to true
      3. Continue with the iteration

        Activity

        Hide
        Charles Oliver Nutter added a comment -
        commit 9e4e5d5884353751e0772eb8ce2a445fa98d0450
        Author: Charles Oliver Nutter <headius@headius.com>
        Date:   Thu Aug 2 12:43:07 2012 -0500
        
            Fix JRUBY-6056: High CPU Loop with parallel Etc.group iterrations
            
            Added the same check that MRI has here.
        
        :100644 100644 5e82105... bacf230... M	src/org/jruby/ext/etc/RubyEtc.java
        
        Show
        Charles Oliver Nutter added a comment - commit 9e4e5d5884353751e0772eb8ce2a445fa98d0450 Author: Charles Oliver Nutter <headius@headius.com> Date: Thu Aug 2 12:43:07 2012 -0500 Fix JRUBY-6056: High CPU Loop with parallel Etc.group iterrations Added the same check that MRI has here. :100644 100644 5e82105... bacf230... M src/org/jruby/ext/etc/RubyEtc.java

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Chris White
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: