Mega Code Archive

 
Categories / Ruby / Threads
 

Each thread is given only one second to execute

threads.each do |thread|   puts "Thread #{thread.object_id} didn't finish within 1s" unless thread.join(1) end