i am in a very sticky situation as i am unable to figure out the problem with my producer-consumer problem using pthreads. the code compiles but when i run the code nothing happens and the expected output does not show. i believe there is a probelem in my producer and consumer threads with the if/else statement but i may be something else. the code is as shown below:
To compile it on command line:
gcc -pthread -lrt semaphore.c -o semaphore
Once you run the program it dosent display the correct output