Ruby - Concurrent Programming
What will be the output of this Ruby code considering the GIL?
count = 0
threads = 5.times.map do
Thread.new do
1000.times { count += 1 }
end
end
threads.each(&:join)
puts count
What will be the output of this Ruby code considering the GIL?
count = 0
threads = 5.times.map do
Thread.new do
1000.times { count += 1 }
end
end
threads.each(&:join)
puts count
15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions