Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. begin
  2. while testIndex < testCases.length # End when every testcase has been tested
  3. if(Thread.list.count<threadLimit+1) # if thread slot available
  4. th[testIndex] = Thread.new(testIndex){ |i| # Create Thread
  5. # get testCase input
  6. # initiate driver and run test
  7. # I have wraper for this, and there is no thread inside it, just single thread code
  8. }
  9. end
  10. end
  11.  
  12. th.each{|t|
  13. if(!t.nil?)
  14. t.join # Wait unfinished thread
  15. end
  16. }
  17. rescue Exception => e
  18. puts "MESSAGE: #{e}"
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement