Ruby - Concurrent Programming
Which Ruby code snippet correctly starts two threads that print numbers?
Option A:
threads = [Thread.new { puts 1 }, Thread.new { puts 2 }]
threads.each(&:join)
Option B:
Thread.new { puts 1 }
Thread.new { puts 2 }
Option C:
threads = Thread.new { puts 1 }
threads = Thread.new { puts 2 }
threads.join
Option D:
Thread.start { puts 1 }
Thread.start { puts 2 }
