Skip to content

Instantly share code, notes, and snippets.

@deepak
Created April 5, 2010 11:29
Show Gist options
  • Save deepak/356257 to your computer and use it in GitHub Desktop.
Save deepak/356257 to your computer and use it in GitHub Desktop.
# usage: ruby thread_simple.rb
thread1 = Thread.new {
while(true) do
print '*'
sleep 0.1
end
}
# if we set sleep the print never gets executed even after waiting for
# 5 seconds. WTF!!!
thread1.join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment