grosser/parallel — Issue #26: Potential race condition with in_threads
Author: ryanlecompte
Created: 2012-01-26 06:31:08+00:00
State: open

It looks like the block passed to Thread.new ends up writing its output to a shared 'out' array that is a local variable. I think there is a potential race condition here since multiple threads could be concurrently writing their results to the same array, which is not a thread-safe data structure. This is probably more visible in JRuby where more than a single thread can be executing at a given time.