subject
Computers and Technology, 20.09.2020 16:01 cici170

In this question, you are required to simulate the starving problem that a process may suffer if all other processes in the system have higher priority than its priority. It is required to create at least two processes (P1 and P2) with priorities 40 and 35 for example. You should create a third process (Pstav) with less priority such as 25.
You may need to put P1 and P2 in the sleep state every couple of seconds to simulate a context switch between P1 and P2. When P1 sleeps, P2 will run and when P2 sleeps, P1 will run. Until now, Pstarv will not be able to run since its priority is the lowest priority. You need to fix that. You are required to change/update/increase the priority of Pstarv each time a context switch occurs.
So, after a number of context switches, Pstarv will finally be able to run to print its ID and print a celebration message that it is finally running.
Feel free to assume any missing information such as should you have a flag or an argument to decide which process you are interested to avoid starvation, should you use shell commands or not, should you increase the Pstarv priority by 1 or by 5…..… etc. P1 and P2 should not know anything about the Pstarv process. Do not hardcode it inside P1 or P2. So, you should not include the code of increasing the Pstarv priority in P1 nor P2.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:30
How can you know if the person or organization providing the information has the credentials and knowledge to speak on this topic? one clue is the type of web site it is--the domain name ".org" tells you that this site is run by a nonprofit organization.
Answers: 2
question
Computers and Technology, 23.06.2019 09:10
Effective character encoding requires standardized code. compatible browsers. common languages. identical operating systems.
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
Describe three characteristics of at-risk drivers. a. b. c. describe three characteristics of safe drivers. a. b. c. describe three driver errors that could cause a collision. a. b. c. how will this information affect you as a driver now and in the future? (2-3 sentences)
Answers: 2
question
Computers and Technology, 23.06.2019 15:30
Write a program in plp assembly that counts up by one starting from zero (or one) inside a loop and writes this value to the leds every time the value is increased. the memory address of the leds is 0xf0200000. the table below shows the meaning and an example usage of the instructions covered in the video, plp instructions for project 1. instruction example usage meaning load immediate li $t0, 8 register $t0 is set to the value, 8. store word sw $t2, 0($t1) the value in register $t1 is used as the memory address. the value in register $t2 is copied into this memory address. add addiu $t4, $t3, 29 register $t4 is assigned the sum of 29 and the value in register $t3. jump j your_label_name the program jumps to the line following the label, "your_label_name: ". label your label name: defines a label called "your_label_name: " that can be jumped to
Answers: 2
You know the right answer?
In this question, you are required to simulate the starving problem that a process may suffer if all...
Questions
question
Mathematics, 19.01.2021 14:30
question
Mathematics, 19.01.2021 14:30
question
Computers and Technology, 19.01.2021 14:30
question
Mathematics, 19.01.2021 14:30
question
Mathematics, 19.01.2021 14:30
question
Social Studies, 19.01.2021 14:30
question
Social Studies, 19.01.2021 14:30
question
Mathematics, 19.01.2021 14:30
question
Mathematics, 19.01.2021 14:30