Simulation Process management in C