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, 21.06.2019 18:10
In mathematics and computer science, a set is a collection in which order does not matter and there are no duplicates. in this problem, we are going to to define a class which wil allow us to create an object to represent a set of integers. you will write a program set.java to define the class set. each instance of the class set will be an object representing a set of integers.
Answers: 3
question
Computers and Technology, 23.06.2019 01:20
Write a function balancechemical to balance chemical reactions by solving a linear set of equations. the inputs arguments are: reagents: symbols of reagents in string row array products: symbols of products in string row array elements: elements in the reaction in string row array elcmpreag: elemental composition of reactants in two dimensional numeric array elcmpprdcts: elemental composition of prducts in two dimensional numeric array hint: the first part of the problem is setting up the set of linear equations that should be solve. the second part of the problem is to find the integers from the solution. one way to do this is to mulitiply the rational basis for the nullspace by increasing larger integers until both the left-and right-side integers exist. for example, for the reaction that involves reacting with to produce and : reagents=["ch4", "o2"]; products =["co2", "h2o"]; elements =["c","h", "o"] elcmpreag=[1,4,0;
Answers: 3
question
Computers and Technology, 23.06.2019 17:00
*! 20 points! *jeff wants to create a website with interactive and dynamic content. which programming language will he use? a. dhtml b. html c. css d. javascript
Answers: 1
question
Computers and Technology, 24.06.2019 07:20
3pointsyou've found an image you want to insert into your slide presentation. youwant to make the image look more gray so that it looks like an older imagewhat would you need to adjust? 0.00o a. sizeo b. hueo c. contrasto d. tones
Answers: 2
You know the right answer?
Playville is a tiny town in fictional middle earth, which is inhabited by dwarves and elves. Playvil...
Questions
question
Computers and Technology, 04.10.2020 05:01
question
Mathematics, 04.10.2020 05:01
question
Mathematics, 04.10.2020 05:01