开发者

What is Ruby's equivalent to Python's multiprocessing module?

To get real concurrency in Ruby or Python, I need to create new processes. Python makes this pretty straightforward using the multiprocessing module, whic开发者_运维百科h abstracts away all the fork / wait goodness and lets me concentrate on my code. Does Ruby have something similar? Right now I am calling Process.fork and Process.wait to get my concurrency, and I want a cleaner solution.


I have used https://github.com/grosser/parallel, and like it a lot. It will #map or #each across all the cores in your system by default. Under the hood it's a wrapper around Process.fork, which sounds like what you're asking for.


https://github.com/pmahoney/process_shared let me know if you have any feature requests for it :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜