Skip to content

Instantly share code, notes, and snippets.

@syusui-s
Last active December 24, 2015 01:19
Show Gist options
  • Select an option

  • Save syusui-s/6722448 to your computer and use it in GitHub Desktop.

Select an option

Save syusui-s/6722448 to your computer and use it in GitHub Desktop.
授業も始まったし、早速
ary = [8,2,3,7,1,2,5,7,8,3,5,6]
result = []
threads = []
ary.each{|e|
threads.push Thread.new{
sleep e
result.push e
}
}
loop do
if not threads.map{|e| e.alive? }.include?(true)
puts result.to_s
exit 0
end
sleep 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment