Ruby - Concurrent Programming
You want to create 3 threads that each print their thread number (1, 2, 3) and then print 'Finished' after all threads complete. Which code correctly achieves this?
i + 1 (1, 2, 3), and stores them in threads.threads.each(&:join) to wait for all threads, then prints 'Finished'. This ensures 'Finished' prints last.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions