Do note, as is mentioned in the comment Thread for the gist, that Fibur is also fully Ruby 1.8 compatible...
Fibur gives you full concurrency during your I/O calls in Ruby 1.9
11–20 of 24 posts
Re: Fibur gives you full concurrency during your I/O calls in Ruby 1.9
#12Re: Fibur gives you full concurrency during your I/O calls in Ruby 1.9
#13Would this be useful for environments where extreme performance is necessary, such as Fibonacci API servers?
Only if you're reading Fibonacci numbers from an I/O. Fibur only allows concurrency while doing I/O operations.
Re: Fibur gives you full concurrency during your I/O calls in Ruby 1.9
#14Re: Fibur gives you full concurrency during your I/O calls in Ruby 1.9
#15These things are usually hard to implement, but Aaron has put his mastery on the table, very clean and well-written code.
Re: Fibur gives you full concurrency during your I/O calls in Ruby 1.9
#16These things are usually hard to implement, but Aaron has put his mastery on the table, very clean and well-written code.
Re: Fibur gives you full concurrency during your I/O calls in Ruby 1.9
#17Re: Fibur gives you full concurrency during your I/O calls in Ruby 1.9
#18What benefits does Fibur give you that em-synchrony doesn't? Not suggesting there isn't a need for a competitor, but trying to place it in the space.
Re: Fibur gives you full concurrency during your I/O calls in Ruby 1.9
#19Would this be useful for environments where extreme performance is necessary, such as Fibonacci API servers?
Only if you're reading Fibonacci numbers from an I/O. Fibur only allows concurrency while doing I/O operations.
def fib(n)
Fibur.pass
return n if (0..1).include? n
fib(n-1) + fib(n-2) if n > 1
end
Now, if you wrap this in Fibur.new, you will get parallel operation!Re: Fibur gives you full concurrency during your I/O calls in Ruby 1.9
#20Earlier quoted context omitted.
Only if you're reading Fibonacci numbers from an I/O. Fibur only allows concurrency while doing I/O operations.
We can use the technique first described here https://github.com/glenjamin/node-fib by using Fibur.pass. def fib(n) Fibur.pass return n if (0..1).include? n fib(n-1) + fib(n-2) if n > 1 end Now, if you wrap this in Fibur.new, you will get parallel operation!
The whole point of Fibur is you don't need to use #pass!!!