I am having some trouble understanding how to use Unix\'s fork()
. I am used to, when in need of parallelization, spawining threads in my application. It\'s always s
Fork has been with us for a very, very, long time. Fork was thought of before the idea of 'start a thread running a particular function' was a glimmer in anyone's eye.
People don't use fork
because it's 'better,' we use it because it is the one and only unprivileged user-mode process creation function that works across all variations of Linux. If you want to create a process, you have to call fork
. And, for some purposes, a process is what you need, not a thread.
You might consider researching the early papers on the subject.