Hi all,
I tried to use fork() in a test program. The idea was to assign a different task at each process (a simple multiplication).
In the end, I would like to sum the two results.
fork creates two identical copies of the program from that point on. They have their own copies of memory. There is no merge to bring them back together. You'd have to arrange for the child to send its results back to its parent (interprocess communication).
It may be more suitable to use seperate threads of execution within the same process rather than seperate threads of execution in different processes. On that basis, you want to check out pthreads.
I knocked up the dot product demo. I hope this helps.