Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.1b1
-
Fix Version/s: JRuby 1.0.3, JRuby 1.1RC2
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:Mac OS X 10.4, MacBook, Core Duo, 2GB RAM
-
Number of attachments :
Description
The Generator seems to have problems with big enumerations:
$ time jruby -rgenerator -e 'gen = Generator.new((0..100000)); gen.next while gen.next?'
real 0m5.699s
$ time jruby -rgenerator -e 'gen = Generator.new((0..100000)); gen.next while gen.next?'
^C
real 3m9.880s
It seems the bigger the number is, the more often jruby hangs up (process goes to sleep.)
This also affects the bm_loop_generator benchmark from Ruby 1.9.
Since the problem doesn't arise always, I can't think of a test case yet.
On channel mele said this seemed to be ok in 1.0.x, but that may just be because it doesn't compile and doesn't run as fast. I'd imagine there's just a threading deadlock somewhere in the generator code. Fix for 1.1 and 1.0.3.