##Run variable##
Run variable
It seems like you want to use the run variable to cause one process to stop if the other one stops. But since each process has its own copy of the run variable, it currently remains at value 1 and serves no purpose.
There are several ways to achieve interprocess communication if you really need this feature (e.g. shared memory, pipes, kill(), waitpid(), etc).