Producer Consumer program using semaphores and pthreads
I have written a code for producer-consumer problem.But I am not getting the output.There is no compilation error,but warning in my program.I am confused.Trying very hard.But can't get it.Please tell me what is wrong in my program.What will be the correct program.I am getting frustrated.Please help guys. Here is the code- #include <pthread.h> #include <stdio.h> #include <stdlib.h> #include </usr/include/semaphore.h> #define BUFF_SIZE 5 /* total number of slots */ #define NP 3 /* total number of producers */ #define NC 3 /* total number of consumers */ #define NITERS 4 /* number of items