Nice opportunity to raise your **Coding Rating**!
Need a program in C/C++ that implements the Banker's Algorithm for a single resource.
What Program Should Do:
Randomly create a state of 4 processes: A,B,C,and D.
For each process A,B,C,D: randomly choose:
[login to view URL] initial assignment of the resources.
[login to view URL] maximum number of resources needed for each process.
[login to view URL] total number of resources available.
An example:
Holds Needs
A 4 2
B 2 5
C 3 6
D 1 2
total available:2
Note:Make sure initial state is safe.
Then randomly create 4 different sequences of requests by the process. An example of one request would be:
B requests 2 resources
C requests 1 resource
D requests 4 resources
A requests 1 resource.
For every request, the driver program should print out the new state and indicate if the state is safe.
If all of the resources are exhausted and the state is unsafe,
then print out that a deadlock has occurred and terminate.
The program should have 4 independent runs.
Code should be well-documented.
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request.
3) Exclusive and complete copyrights to all work purchased. (No GPL, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site).
## Platform
Microsoft Visual C++ 6.0