Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- begin
- while testIndex < testCases.length # End when every testcase has been tested
- if(Thread.list.count<threadLimit+1) # if thread slot available
- th[testIndex] = Thread.new(testIndex){ |i| # Create Thread
- # get testCase input
- # initiate driver and run test
- # I have wraper for this, and there is no thread inside it, just single thread code
- }
- end
- end
- th.each{|t|
- if(!t.nil?)
- t.join # Wait unfinished thread
- end
- }
- rescue Exception => e
- puts "MESSAGE: #{e}"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement