Skip to content

Instantly share code, notes, and snippets.

Created December 26, 2011 19:22
Show Gist options
  • Save anonymous/1521964 to your computer and use it in GitHub Desktop.
Save anonymous/1521964 to your computer and use it in GitHub Desktop.
t1 = Thread.new {
c = 'a'
25.times { print c.next!;sleep 1 }
}
t1.join
t2 = Thread.new {
25.times { |i| print i;sleep 1 }
}
t2.join
Produces: bcdefghijklmnopqrstuvwxyz0123456789101112131415161718192021222324
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment