Write a C Program for use of semaphones in Opearting System.
Theory
producer–consumer problem is a example of a multi-process synchronization problem,
where producer produces items in the buffer and consumer consumes / removes items
from the buffer.
Program Code
Input:
enter a string
abcd
enter a string
abcd
abcd
enter a string
abcd
abcd
abcd
Output:
enter a string
abcd
enter a string
abcd
abcd
enter a string
abcd
abcd
abcd