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 21:30
Write code using c . (take input from user) calculate the size of a given file in kbs. in this task you will complete the function with the following prototype: float get_file_size(char * filename); the function takes the file name (address to the start of a null terminated character array) as input. the function should then open the file and find the number of bytes it contains till eof. the number of bytes divided by 1024 will give the size in kbs. if the file cannot be opened the function should return -1.
Answers: 2
question
Computers and Technology, 22.06.2019 14:30
The “rule of 72” is used to approximate the time required for prices to double due to inflation. if the inflation rate is r%, then the rule of 72 estimates that prices will double in 72/r years. for instance, at an inflation rate of 6%, prices double in about 72/6 or 12 years. write a program to test the accuracy of this rule. for each interest rate from 1% to 20%, the program should display the rounded value of 72/r and the actual number of years required for prices to double at an r% inflation rate. (assume prices increase at the end of each year.)
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
What are some ways to use a range name in a formula? check all that apply. in the defined names group, click use in formula, and then select the desired name. begin typing the name in the formula, select a name from the autocomplete list, and use the arrow keys and tab key to enter the name in the formula. begin typing the formula, and then click and drag with the mouse to select the cells to include in the formula. right-click one of the cells in the range. click formula options, and use the dialog box to add the name.
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
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
Spanish, 08.03.2021 19:30
question
Mathematics, 08.03.2021 19:30
question
Engineering, 08.03.2021 19:30
question
Mathematics, 08.03.2021 19:30
Questions on the website: 13722360