Computers and Technology
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.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:00, sjackson0625p8w1a0
Which action is good business etiquette? a. switching your cell phone off before you enter a meeting b. keeping your cell phone on low volume before you enter a meeting c. setting a pleasant ring tone on your cell phone before you enter a meeting d. setting a standard ringtone on your cell phone before you enter a meeting
Answers: 1
image
Computers and Technology, 22.06.2019 17:30, uh8hardiek
Ou listened to a song on your computer. did you use hardware or software?
Answers: 2
image
Computers and Technology, 22.06.2019 21:30, mima851
Elements such as fonts colors visual structure graphics and the interface of a web page should complement each other to ensure blank
Answers: 3
image
Computers and Technology, 23.06.2019 00:20, mmmmaaarriiieeee
The open systems interconnection (osi) reference model: defines standards for many aspects of computing and communications within a network. is a generic description for how computers use multiple layers of protocol rules to communicate across a network. defines standards for wireless local area network (wlan) communication protocols. details the advantages and disadvantages of various basic network cabling options.
Answers: 1
Do you know the correct answer?
In this question, you are required to simulate the starving problem that a process may suffer if all...

Questions in other subjects:

Konu
Mathematics, 11.05.2021 14:00
Konu
English, 11.05.2021 14:00