Professional Documents
Culture Documents
OS Lab 11 Immad
OS Lab 11 Immad
011
VMware
Ubuntu
VI editor
Introduction:
Task 1: Write a C program to implement Producer and Consumer Problem using Semaphores.
Coding:
#include<stdio.h>
#include<sys/wait.h> cin>>buffer[i]
class ABC{ }
ABC(){ e=0;
} f=1;
int s; }
int e;
cout<<buffer[i]<<"\n"; obj.producer();
e=1; system("pause");
f=0; return 0;
} }
int main(){
output:
Conclusion:
In this lab we have study about the system call and its services. We have learned about the fork (),
wait () and exit () function in this lab. Also, we have executed different process using the above
command to run the program. We performed all the tasks given by the teacher.