For this assignment, you will write a program that simulates the execution of multiple processes with respect to their resource allocation and resource release requests, and detect when (or if) deadlock occurs. If deadlock occurs, your program will then display a list of the processes and resources involved in the deadlock.
Write and test a program (in C, C++, Java, or Python) to carry out the simulation of multiple processes executing the sequences of resource requests and computation specified by the input data, checking after each resource allocation request for the existence of deadlock by attempting to find a cycle in the resource graph. If no deadlocks occur during execution, then for each process indicate the total run time and the time when the process completed. If a deadlock does occur, indicate that fact, the time when the deadlock was detected, and the identification of the processes and resources involved in the circular wait. The samples shown below illustrate the desired output format. No extraneous output (e.g. debugging information) should appear in your output, and tracing information should not appear in the output from your solution. The program must read from the standard input and write to the standard output.
Let’s look at a complete example. Suppose we have three processes with execution action sequences as follows:
Process 1: L1 L2 C2 U1 U2
Process 2: L1 L2 C2 U1 U2
Process 3: L3 C5 U3 C2
Simulation 2 in the sample input and output (below) shows the sequence in which these process actions would occur, and the time (starting at 0) when they would occur.
The set of processes in simulation 2 does not deadlock, but obviously other sequences can (see the samples for several such sequences). To detect deadlock, your program must build a resource graph (with nodes for processes and resources, and directed edges indicating resource ownership and pending resource requests), and test the graph for the existence of a cycle after each resource allocation request is made by a process. This test must be performed after each successful or unsuccessful allocation.
The Input Data
The input data will consist of a sequence of simulation test cases identified by sequential numbers starting with 1. The first line of input for each test case will contain two integers that specify the number of processes (1 ≤ np ≤ 50) and the number of resources (1 ≤ nr ≤ 50). The remaining np lines in the test case specify the actions for each of the np processes, with line i + 1 of the test case input containing the action specifications for process i. Each action specification line contains an integer na (1 ≤ na ≤ 50) that specifies the number of actions for the process and then na action specifications, each consisting of an action type (L, U, or C) followed immediately by an integer. The last test case will be followed by a line containing two integer zeroes. Sample input and output appears below, and illustrates the input format.
There is code in C that is 75% code done. Just need to complete the rest. If you are okay with the project, I could send you the code. Or if you don't want to use this code, you could go from scratch.
Hello, I'm Smile Song, developer in China.
I'm interesting your project very well
I'm a Good SQL, C++, c#, Python, .Net, swift, object-c, OpenCV, Math, Java, Algorithm expert.
Relevant Skills and Experience
I m quite well experienced in these jobs.
Let's go ahead with me
I want to service for you continously.
Proposed Milestones
$144 USD - initial milestone
I am very proficient in c and c++. I have 16 years c++ developing experience now, and have worked for more than 6 years. My work is online game developing, and mainly focus on client side, using c++ under windows environment. I used c++ to make many great projects, for example, I made the tools which can convert java files into c++ scripts, of course garbage collection included, this job is very similar to a compiler, and is very complex. I also made our own mobile game using c++, I can show you the demo of client, if you like. I am very proficient in java also. I have a very good review on Freelancer.com, I never miss a project once I accept the job, you can check my review. Trust me, please let expert help you.
Hello
We are highly motivated young technocrats from India. We are approachable, you can come to us if you have a struggle, we are happy to help.
Team
TiponTongue
Relevant Skills and Experience
Ph.D. in Computer Science and Engineering
Proposed Milestones
$220 USD - Milestone
I would like to offer myself as a probable candidate for this assignment as I am confident of delivering a quality output. I have excellent expertise in this area.
Relevant Skills and Experience
I have total 7 years or experience in web development and design using java,multi-threading,algorithm,Simulation,Deadlock,j2ee. already done some assignments like this
Proposed Milestones
$155 USD - java
Experience C/C++ developer in Silicon Valley. Able to write simple code that does the task and easy to understand.
Relevant Skills and Experience
C/C++, Java using Eclipse IDE, Python. Debugging skills and also translating big problems into simple and easy to understand solutions.
Proposed Milestones
$20 USD - Understanding the problem in detail and pseudo coding
$90 USD - Completion to your satisfaction
Additional Services Offered
$200 USD - Any other support after project completion
Will get the job done in a timely and accurate manner. Just pick me, you will not be disappointed.
Hey !
I'm SAYAN PROGRAMMER
I've reviewed your complete job description, and I fulfill all the qualifications required for this project.
I have completed 200 projects with clients 100% satisfaction and I am sure if you will respond me then I will be able to explain my skills as well.
I have more than 15 years of experience in this field.
I always try to provide good quality work to my clients.
My key skills are:
C #, C + +, C programming ,JAVA, Software Development, Software Architecture, PHP, Java script and much more.
Looking forward to work with you on this project.
THANKS
Regards
SAYAN PROGRAMMER