4 ms·
NodeJS is single-threaded while Ruby has native threads and "fibers" - what makes you say you wouldn't be able to utilize additional cores in Ruby?
by 3np 6y ago
NodeJS is single-threaded while Ruby has native threads and "fibers" - what makes you say you wouldn't be able to utilize additional cores in Ruby?
- schneems 6y agoFibers are still restricted by the GVL. Threads are also restricted by the GVL. The only "true" concurrency in MRI is to fork a process.
- winrid 6y agoYou can. You can with Node too. With Node you can just use workers. I have tools I wrote in Node that can max out my 16 core MacBook.
- 3np 6y agoSome major differences here are how they interface with I/O and the mechanisms around memory sharing. Nodejs workers are more like webworkers and mostly suitable for proper CPU-intensive parallelization whereas in Ruby it's not uncommon to run e.g. multithreaded web server in the same process and namespace.