How do you use the fork () command so that you can create 10 processes and perform their small task at the same time.
Concurrent is a quick word, in many places that show how to use fork, use only one fork () call in your demos. I thought you would use some kind of loop cycle, but I tried, and it seems in my tests that fork () spawns a new process, does the work, and then spawns a new process. So they seem to work sequentially, but how can I use fork at the same time and have 10 processes doing work at the same time, if that makes sense?
Thanks.
Update: Thanks for the answers guys, I just misunderstood some aspects of fork (), but I understand it now. Greetings.
c command-line unix concurrency multiprocessing
Brock woolf
source share