1 - You can get the return value of fork(),so you can debug it. eg pid = 0, in the children process, pid >0 ,in the father process.
But if I want to debug the father and children process at the same time ,how to do?
2 - How do you know which process will be run ? why?