Showing posts with label Operating System. Show all posts
Showing posts with label Operating System. Show all posts

Sunday, June 12, 2011

BANKER'S ALGORITHM TO DETECT DEADLOCKS


#include<iostream.h>
#include<conio.h>
#define MAX 5
class bankers
{
 private:
 int al[MAX][MAX],m[MAX][MAX],n[MAX][MAX],avail[MAX];
 int nop,nor,k,result[MAX],pnum,work[MAX],finish[MAX];
 public:
 bankers();
 void input();
 void method();
 int search(int);
 void display();
};