subject

Playville is a tiny town in fictional middle earth, which is inhabited by dwarves and elves. Playville has a playground to which dwarves and elves go if they wish to play. The sporting rules of Playville state that a play can take place only if either there are 5 dwarves or 3 elves present to play. If the playing condition is not met (i. e., 5 dwarves or 3 elves are not present at the playground), an arriving person (dwarf or elf) has to wait in their respective waiting area near the playground. When either the dwarves or the elves have their quorum, they move on to the playground to play, if the playground is already not in use. The playground, at any time, is either empty or it is occupied by playing dwarves or it is occupied by playing elves.

After a dwarf or elf team has played to its satisfaction, it leaves the ground. Assume all dwarves are identical to each other, and all elves are identical to each other too.

a. Assuming dwarves and elves to be concurrent processes, and using P and V operations, devise an algorithm for each type of process.
b. Is your solution correct?
c. Discuss possibly what you could do to improve your solution.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 18:30
Jacking is a crime that takes place when a hacker misdirects url to a different site. the link itself looks safe, but the user is directed to an unsafe page
Answers: 1
question
Computers and Technology, 25.06.2019 05:00
What should you do if a dialog box covers an area of the screen that you need to see?
Answers: 1
question
Computers and Technology, 25.06.2019 16:30
How many times do you usually use npm? put your answer in the box.
Answers: 1
question
Computers and Technology, 26.06.2019 09:30
Ben is writing web page content for a newly launched gaming gadget. he has to use hyperlinks to visitors navigate to web pages that deal with other types of electronic gadgets. what is the ideal place for the hyperlinks in the web page? a. at the bottom of the web page b. below the text that describes each feature c. above the text that describes each feature d. beside the text that describes each feature
Answers: 1
You know the right answer?
Playville is a tiny town in fictional middle earth, which is inhabited by dwarves and elves. Playvil...
Questions
question
History, 09.10.2021 14:00
question
Mathematics, 09.10.2021 14:00
Questions on the website: 13722359