1. Homepage
  2. Exam
  3. [2021] Massey - 159.341 Programming Languages, Algorithms AND Concurrency - Final Exam - Q3 DeadLock

[2021] Massey - 159.341 Programming Languages, Algorithms AND Concurrency - Final Exam - Q3 DeadLock

This question has been solved
Engage in a Conversation

Question 3 – Deadlock [10 marks]

  CourseNana.COM

a) Briefly explain the difference between deadlock prevention and deadlock [2 marks] CourseNana.COM

avoidance. CourseNana.COM

  CourseNana.COM

b) Four blacksmiths – Andrew, Beth, Chris and Daisy are working on four [8 marks] CourseNana.COM

separate projects in their shared forge. Collectively they have the following equipment: CourseNana.COM

4 Hammers CourseNana.COM

8 Punches CourseNana.COM

3 Swages CourseNana.COM

5 Tongs CourseNana.COM

  CourseNana.COM

Each piece of equipment can only be used by one blacksmith at a time. CourseNana.COM

  CourseNana.COM

Andrew needs at most 2 Hammers, 3 Punches, 3 Swages and 1 Tongs CourseNana.COM

Beth needs at most 2 Hammers, 3 Punches, 1 Swage and 1 Tongs CourseNana.COM

Chris needs at most 1 Hammer, 2 Punches and 4 Tongs CourseNana.COM

Daisy needs at most 3 Hammers, 4 Punches, 1 Swage and 2 Tongs CourseNana.COM

  CourseNana.COM

At some point in time the equipment is being used as follows: CourseNana.COM

Andrew has 1 Hammer and 2 Punches. CourseNana.COM

Beth has 1 Punch, 1 Swage and 1 Tongs. CourseNana.COM

Chris has 1 Hammer, 1 Punch and 1 Tongs. CourseNana.COM

Daisy has 1 Punch, 1 Swage and 1 Tongs. CourseNana.COM

  CourseNana.COM

i. Is this state safe? Use the bankers algorithm to prove your answer and identify a safe sequence (if one exists). CourseNana.COM

  CourseNana.COM

ii. Andrew requests the use of 1 Tongs, is it safe to grant this request? Justify your answer by either showing a safe sequence or explaining why one does not exist. CourseNana.COM

  CourseNana.COM

iii. If instead Daisy requests the use of 1 Punch, is it safe to grant this request? Again justify your answer by either showing a safe sequence or explaining why one does not exist. CourseNana.COM

Get the Solution to This Question

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
Messey University代写,159.341代写,Programming Languages代写, Algorithms AND Concurrency代写,Messey University代编,159.341代编,Programming Languages代编, Algorithms AND Concurrency代编,Messey University代考,159.341代考,Programming Languages代考, Algorithms AND Concurrency代考,Messey Universityhelp,159.341help,Programming Languageshelp, Algorithms AND Concurrencyhelp,Messey University作业代写,159.341作业代写,Programming Languages作业代写, Algorithms AND Concurrency作业代写,Messey University编程代写,159.341编程代写,Programming Languages编程代写, Algorithms AND Concurrency编程代写,Messey Universityprogramming help,159.341programming help,Programming Languagesprogramming help, Algorithms AND Concurrencyprogramming help,Messey Universityassignment help,159.341assignment help,Programming Languagesassignment help, Algorithms AND Concurrencyassignment help,Messey Universitysolution,159.341solution,Programming Languagessolution, Algorithms AND Concurrencysolution,