i have written this linux code that executes multiple processes.
it is running well, but the problem is that when i run it for the first few times it runs great without any fault, but after that it runs with deadlocks in it
here it is
semaphore pr = 3;
semaphore mutex = 1;
int i = 0;