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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 21:10, itsmichaelhere1
Dameas communication challenge is due to which factor
Answers: 2
image
Computers and Technology, 24.06.2019 00:30, louie8656
Match the sentence fragment in the first column with the appropriate ending in the second column. a little per favore?
Answers: 1
image
Computers and Technology, 24.06.2019 10:30, johngayden46
This device directs network traffic. bridge hub nic repeater router switch
Answers: 3
image
Computers and Technology, 24.06.2019 20:10, austinwst3
Approximately what portion of global employers tends to use social media websites to hire new employees?
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 in other subjects:

Konu
Mathematics, 06.10.2021 14:00
Konu
Mathematics, 06.10.2021 14:00
Konu
Mathematics, 06.10.2021 14:00