There is another difference.
You can easily code your programs using threads in (almost) exactly the same way as you would using fork. Simply not sharing the data will cause it to be duplicated(without the COW obviously) and each thread will be able to use it's copy of the data saftly without performing any locking, or even giving it any consideration.
The advantage comes when each of the 'processes' has reach a result. At that point, it becomes extremely easy for the 'parent process' (originating thread) to gather all the results from its children together and perform further processing -- eg. collating those results -- without requiring a tiresome and dangerous adventure holiday to the mysterious world of Eyepee Sea.
Examine what is said, not who speaks.
"But you should never overestimate the ingenuity of the sceptics to come up with a counter-argument." -Myles Allen
"Think for yourself!" - Abigail
"Time is a poor substitute for thought"--theorbtwo
"Efficiency is intelligent laziness." -David Dunham
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
| [reply] |