GitHub repository: karnakaushik/ProducerConsumerProject
Primary language: C
Created: 2018-03-18T17:54:30Z
Description: In this project, we will design a programming solution to the bounded-buffer problem using the producer and consumer processes. For this project, we will use standard counting semaphores for empty and full and a mutex lock, rather than a binary semaphore, to represent mutex. The producer and consumer—running as separate threads—will move items to and from a buffer that is synchronized with the empty, full, and mutex structures. This problem represents the common problem of process synchronization in operating systems. In the given solution there is a critical section for every process whether it is producer or consumer that is to be executed without any interruption. There is a semaphore named full that check number of filled spaces in array and similarly empty semaphore checks for the number of empty spaces in the buffer. Mutex lock ensures that the critical section is executed without any interruption.