Skip to content

Instantly share code, notes, and snippets.

@mauricio
Last active August 29, 2015 14:13
Show Gist options
  • Save mauricio/826542a4abe1b068a70e to your computer and use it in GitHub Desktop.
Save mauricio/826542a4abe1b068a70e to your computer and use it in GitHub Desktop.
def fib( n )
return n if ( 0..1 ).include? n
( fib( n - 1 ) + fib( n - 2 ) )
end
threads = []
4.times do
threads << Thread.new do
fib(50) while true
end
end
threads.each do |t|
t.join
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment