Ruby - Concurrent Programming
Given this Ruby code, what is the expected output considering the GIL?
require 'thread'
mutex = Mutex.new
count = 0
threads = []
5.times do
threads << Thread.new do
1000.times do
mutex.synchronize { count += 1 }
end
end
end
threads.each(&:join)
puts count