External command spawning in multiple concurrent threads can go boom
--------------------------------------------------------------------

                 Key: JRUBY-3057
                 URL: http://jira.codehaus.org/browse/JRUBY-3057
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1.4
            Reporter: Thomas E Enebo


Our external processing code ends up requiring some ruby libraries. this does 
not work well when n threads all require at the same time.  Here is some code 
to show it explode (may take multiple runs to see it):

{noformat}
threadPool = []

list = %w(aS bS cS dS eS fS gS hS)

for sys in list
 threadPool << Thread.new(sys) {|numericalSys|
   while 1
     res = %x[date]
     puts "#{numericalSys}, #{res}\n"
     sleep 2
   end
 }
end

threadPool.each {|eachThread| eachThread.join}
{noformat}

Adding the file required before thread stuff will workaround the issue:

{noformat}
require 'rbconfig'
require 'jruby'
{noformat}

-- 
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