Alex Rivera | Logout

What's the difference between Process.fork and Process.spawn in Ruby 1.9.2

Asked 2010-11-08T23:49:54.423
32

What's the difference between Process.fork and the new Process.spawn methods in Ruby 1.9.2 and which one is better to run another program in a subprocess? As far as I understand Process.fork accepts block of code and Process.spawn takes a system command plus some other parameters. When I should use one instead of the other?

Edit
Report

1 Answer

0

I believe Process.Fork forks the current process, and Process.Spawn spawns a new process. They are quite different. Do you want a new thread or a new process?

answered 2010-11-08T23:54:53.617

Your Answer