Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Task 2. Total 10% Race conditions are possible in many computer systems. Consider a movie booking system that maintains the total number of tickets available
Task 2. Total 10% Race conditions are possible in many computer systems. Consider a movie booking system that maintains the total number of tickets available with the following functions: buy(int count) { available -- count; 3 refund(int amount) { available += count; > Page 3 Assume that the system calls buy() function for a user Ali who wants to buy some tickets, and calls refund() for another user Mary to wants to refund some tickets. Describe how a race condition is possible and what might be done to prevent the race condition from occurring. Task 3. Total 10% Study the two resource-allocation graphs below. Which of the resource-allocation graphs illustrate deadlock? Note that one process may request for multiple instances of the same resource. . For those situations that are deadlocked, (i) provide the cycle of processes and resources, and (ii) explain for each process why it cannot proceed with the execution. Where there is not a deadlock situation, elaborate how all processes can complete their executions RI Rz R 5 ) (a) (b)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started