3 ms·
I'd be curious to have a good example of when to use a Fiber vs a Ractor in Ruby. I'm assuming it's much much faster to spawn a Fiber? Or am I missing something
by nixpulvis 5y ago
I'd be curious to have a good example of when to use a Fiber vs a Ractor in Ruby. I'm assuming it's much much faster to spawn a Fiber? Or am I missing something?
- chrisseaton 5y agoFibres are best for concurrency. Ractors are best for parallelism.
- jrochkind1 5y agoIn actual practice... ractors are kind of still new experimental technology, that are hard to use if you are using any existing gem code. And fibers are not new, but also can be hard to use and aren't super popular in general use. So the practical answer is you probably won't use either. :) But one way to explain the difference is that fibers are basically for cooperative/evented concurrency, while ractors are a new invention that are more like (OS native) threads but without shared memory.