3 ms·
So if I have 2 CPU-bound tasks, none of the tools in this toolbox will allow them to run in parallel on multiple cores?
by keypusher 11y ago
So if I have 2 CPU-bound tasks, none of the tools in this toolbox will allow them to run in parallel on multiple cores?
- chrisseaton 11y agoNot if you use MRI, but they will if you use Rubinius or JRuby.
- vidarh 11y agoThey can't run in parallel while in the interpreter on MRI. Code that spends lot of time in the kernel (long running system calls for IO etc.) or in C extensions (say database adapters) can run properly in parallel, so on MRI it very much depends on your workload. If you want to ensure proper parallelism, then fork.
- s_kilk 11y agoCorrect, on MRI at least.
- est 11y agoIf you are even thinking about running CPU-intensive tasks in Python or Ruby, you are doing it wrong, it's not fast anyway.