Skip to content

Instantly share code, notes, and snippets.

@aalvesjr
Created August 29, 2012 20:38
Show Gist options
  • Select an option

  • Save aalvesjr/3518595 to your computer and use it in GitHub Desktop.

Select an option

Save aalvesjr/3518595 to your computer and use it in GitHub Desktop.
Brincando com Threads no Ruby
t1 = Thread.new do
puts "Na thread 1"
sleep(6)
puts "ainda na thread 1"
sleep(3)
puts "fim da thread 1"
end
t2 = Thread.new do
puts "Na thread 2"
sleep(8)
puts "Outro puts da thread 2"
sleep(12)
puts "fim da thread 2"
end
while(true) do
puts "Aguardando threads"
sleep 5
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment