I have an Assignment (yes I know everyone loves homework questions), in which I'm supposed to be allowing the CPU scheduler pick which of two forked processes it runs next. Essentially, I fork()
, then pass a number to an exec()
in each fork that simply counts up to that number, printing to screen. The objective is to show how the Scheduler is Round Robining between each one. But they keep throwing Zombie!
a little ways in.
Doing some research, it's because I need to have the parent wait()
on the child, or at the least use pipes to make sure they don't stumble on each other. But that defeats the purpose of what I've set out to do, as I am now arbitrarily setting the schedule through wait()
or pipes.
Does anyone know how to let two forked processes just run next to each other without throwing a Zombie!
without making them wait on each other?