Professional Documents
Culture Documents
ON
“Banker’s Algorithm ”
Submitted By
Page | 1
Operating system LAB Report
CERTIFICATE
“Banker’s Algorithm ”
Page | 2
Operating system LAB Report
ACKNOWLEDGEMENT
We would like to express our gratitude and appreciation to all those who gave us the possibility
to complete this project and this report. I and my team thank our head of department Prof. Indira
Joshi for giving us the accessory environment to acquire knowledge and skill. A special thanks to
Mr. Kalidas Bhawale, whose help, stimulating suggestions and encouragement, helped us to
coordinate our project especially in writing this report.
We would also like to acknowledge with much appreciation the crucial role of the staff of
Computer Laboratory, who gave the permission to use all required machinery and the necessary
material to complete the report special thanks goes to our friends, who gave suggestions about
the source code.
Page | 3
Operating system LAB Report
CONTENTS
01 THEORY 5-7
02 PROGRAM 8-10
03 RESULTS 11-13
04 CONCLUSION 14
05 REFERENCES 15
Page | 4
Operating system LAB Report
CHAPTER 1
THEORY:BANKER’S ALOGORITHM
Page | 5
Operating system LAB Report
Page | 6
Operating system LAB Report
Page | 7
Operating system LAB Report
CHAPTER 2
PROGRAM
#include <stdio.h>
#include <stdlib.h>
int main()
{
int Max[10][10], need[10][10], alloc[10][10], avail[10], completed[10],
safeSequence[10];
int p, r, i, j, process, count;
count = 0;
Page | 8
Operating system LAB Report
do
{
printf("\n Max matrix:\tAllocation matrix:\n");
process = -1;
if(process != -1)
{
printf("\nProcess %d runs to completion!", process + 1);
safeSequence[count] = process + 1;
count++;
for(j = 0; j < r; j++)
{
avail[j] += alloc[process][j];
alloc[process][j] = 0;
Max[process][j] = 0;
completed[process] = 1;
}
}
}
while(count != p && process != -1);
if(count == p)
{
printf("\nThe system is in a safe state!!\n");
printf("Safe Sequence : < ");
for( i = 0; i < p; i++)
printf("%d ", safeSequence[i]);
printf(">\n");
}
else
printf("\nThe system is in an unsafe state!!");
Page | 10
Operating system LAB Report
CHAPTER 4
OUTPUT
Page | 11
Operating system LAB Report
Page | 12
Operating system LAB Report
Page | 13
Operating system LAB Report
CHAPTER 5
CONCLUSION
We have successfully execute the program .The things we required
“TURBO C AND INTERNET (For reference purpose only)”.It was a
great experience to design and implement the Banker’s Algorithm.
While working on this project , I have learned many things especially
how to apply the concept of c language while making chat room. In
this project we have used the basics of c language while making
banker’s algorithm . This project helped me to get the better
understanding to develop algo of Banker’s Algorithm. After doing
this project, I am Position to explain Banker’s Algorithm mini
project.
Page | 14
Operating system LAB Report
CHAPTER 7
REFERENCES
www.google.com
www.wikipedia.com
LIBRARY BOOKS
Page | 15