popen IO lockup with multiple threads
-------------------------------------
Key: JRUBY-2941
URL: http://jira.codehaus.org/browse/JRUBY-2941
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.1.3
Environment: Linux Sun JRE 1.6 amd64
Reporter: Michal Suchanek
Attachments: testt.rb
Running the attached program locks up in first iteration in JRuby but allows
thousands of iterations in MRI.
This change works around the issue in JRuby:
--- testt.rb 2008-08-21 10:18:07.000000000 +0200
+++ testt.rb~ 2008-08-21 09:03:24.000000000 +0200
@@ -2,7 +2,7 @@
analyzer = IO.popen( 'cat', IO::RDWR )
res = []
- t = Thread.new( (analyzer),res){|fd,ary|
+ t = Thread.new( (IO::for_fd analyzer.fileno),res){|fd,ary|
while l = fd.gets do
STDERR.putc 8
ary.push l
--
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