Menu

[Solved]Need Code C C 1 Introduction Purpose Assignment Become Familiar Deadlock Starvation Implem Q37083789

I need a code in C or C++

1      Introduction

The purpose of this assignment is to become more familiar withdeadlock and starvation. You will do this by implementing theDining Philosophers Algorithm. You can find the algorithm in yourOperating Systems book.

2       Handout Instructions

There is no handoutfor this assignment. You will start from a “blank page” for thisassignment, so all of your code should be your own. You can lookaround for ideas and to understand concepts by findingimplementations on the internet or in books, but your final codeshould be your own. NO COPYING AND PASTING! Please includereferences to any code, websites, and books you use to get ideasand increase your understanding.

3      Assignment

Use threads to implement three versions of the DiningPhilosophers problem. One of the programs must be free from bothdeadlock and starvation. One of them should be vulnerable todeadlock, and the last should be vulnerable to starvation.

4       Programming Rules

This is an individual assignment. Work on your own and do notdiscuss code with your classmates. As always, you may discussconcepts with me and your classmates during class time, but do notshare code.

You may use any language you wish to implement this assignment,with certain restrictions. You must explicitly use threads.

Remember that all of your code should be your own. You can lookaround for ideas and to understand concepts by findingimplementations on the internet or in books, but your final codeshould be your own. NO COPYING AND PASTING! Please includereferences to any code you use to get ideas and/or increase yourunderstanding.

Finally, you will write a report explaining your implementationand addressing the following questions:

  1. What method did you use to ensure that one version of yourprogram was susceptible to starvation but not deadlock?
  2. What method did you use to ensure that one version of yourprogram was susceptible to deadlock but not starvation?
  3. What method did you use to ensure that one version of yourprogram was not susceptible to starvation or deadlock?

5      Evaluation

Your score will be computed out of a maximum of 100 points basedon the following distribution:

60 Correctness points.

20 Report points.

20 Presentation points.

Correctness points. Your solution must produce thecorrect output and you must have all three versions specifiedabove.

Report points. Your report for this assignment shouldbe more extensive than for previous assignments. Your report shouldexplain exactly how your implementation works and include snippetsfrom your code where applicable.

Presentation points. You will demonstrate your code tome. You must demonstrate the vulnerabilities specified above andexplain in your own words exactly how you made each version of yourprogram susceptible to the correct vulnerability.

6       Handin Instructions

Submit Philosophers usingElearning.

You will submit yourassignment as a single .zip file. It should include your report PDFfile, which I would like you to name:

Philosophers-Report-[YourName].pdf

Also include your program file(s) anda README.txt file, which will contain authorship information andany references.

Please name your .zip file in thefollowing way:

CS5541-[YourName]-Philosophers.zip

Expert Answer


Answer to I need a code in C or C++ 1 Introduction The purpose of this assignment is to become more familiar with deadlock and sta… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *