Operating Systems Lab Manual / OS Producer Consumer Problem using Semphore C Program

Program Name Write a C Program for Producer consumer problem.
Theory
Producer consumer problem is a synchronization problem where producer, consumer are processes.
where producer produces items and consumer process consumes items produced by producer. 
Items produces by producer are keepen in a buffer and its fixed size from where consumer process 
consumes items.
Program
Input
 1.producer 	 2.consumer 	 3.Exit
 Enter your choice: 2

Buffer is Empty
 
 1.producer 	 2.consumer 	 3.Exit
 Enter your choice: 1

Enter the value: 10

 
 1.producer 	 2.consumer 	 3.Exit
 Enter your choice: 3

Output
 1.producer 	 2.consumer 	 3.Exit
 Enter your choice: 2

Buffer is Empty
 
 1.producer 	 2.consumer 	 3.Exit
 Enter your choice: 1

Enter the value: 10

 
 1.producer 	 2.consumer 	 3.Exit
 Enter your choice: 3


Home     Back