6 kyu

Wait on All Threads

Description:

Create a method called wait_on_threads that accepts an array of threads (can be empty) and waits until all of them finish. For example:

thread1 = Thread.new do
  # do somethng
end
thread2 = Thread.new do
  # do somethng else
end

wait_on_threads( [thread1,thread2] )
# Should wait inside the method until both thread1 and thread2 
# finish whatever they were doing and exit. 

You can read more about threads in wikipedia: http://en.wikipedia.org/wiki/Thread_(computing)

Threads
Fundamentals

Similar Kata:

More By Author:

Check out these other kata created by moonfly

Stats:

CreatedSep 25, 2014
PublishedSep 25, 2014
Warriors Trained560
Total Skips169
Total Code Submissions458
Total Times Completed171
Ruby Completions171
Total Stars3
% of votes with a positive feedback rating85% of 56
Total "Very Satisfied" Votes43
Total "Somewhat Satisfied" Votes9
Total "Not Satisfied" Votes4
Total Rank Assessments31
Average Assessed Rank
6 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • moonfly Avatar
  • user5036852 Avatar
Ad