subject

The following pseudo code implements the suspend() and activate() functions. Two new states are introduced, suspended_ready and suspended_blocked, to keep track of the state in which a process was suspended. That is, a ready process moves to the suspended_ready state by the suspend function. Similarly, a blocked process moves to the suspended_blocked state by the suspend function. The activate function reverses the transitions. suspend() { if (p. process_state == blocked) p. process_state - suspended_blocked else p. process_state = suspended_ready } activate() { if (p. process_state == suspended_ready) p. process_state - ready else p. process_state - blocked scheduler() (a) What changes must be made to the scheduler or other functions to make suspend/activate work correctly?
(b) Why is the scheduler called only in activate but not in suspend?
(c) A process must be prevented from calling suspend() or activate() on itself. Why?
(d) A process must be prevented from calling suspend() on an already suspended process, or calling activate() on a currently active (ready) process. Why?

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
Which of the following is a way the operating system prevents unknown or unauthorized users from accessing the system?
Answers: 2
question
Computers and Technology, 22.06.2019 19:30
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 1
question
Computers and Technology, 23.06.2019 03:00
Jason, samantha, ravi, sheila, and ankit are preparing for an upcoming marathon. each day of the week, they run a certain number of miles and write them into a notebook. at the end of the week, they would like to know the number of miles run each day, the total miles for the week, and average miles run each day. write a program to them analyze their data. your program must contain parallel arrays: an array to store the names of the runners and a two-dimensional array of five rows and seven columns to store the number of miles run by each runner each day. furthermore, your program must contain at least the following functions: a function to read and store the runners’ names and the numbers of miles run each day; a function to find the total miles run by each runner and the average number of miles run each day; and a function to output the results. (you may assume that the input data is stored in a file and each line of data is in the following form: runnername milesday1 milesday2 milesday3 milesday4 milesday5 milesday6 milesday7.)
Answers: 3
question
Computers and Technology, 23.06.2019 18:00
Ramona enjoys her job because she is able to kids in an after school program. the work value ramona feels strongest about is a. leadership b. risk c. independence d. work with people select the best answer from the choices provided a b c d
Answers: 1
You know the right answer?
The following pseudo code implements the suspend() and activate() functions. Two new states are intr...
Questions
question
Mathematics, 27.02.2020 04:13
question
Mathematics, 27.02.2020 04:13
Questions on the website: 13722361