Question: Trouble with hmwk can anyone help? I. (16 points) Select the appropriate answer from the selection provided at the bottom of the page and write
Trouble with hmwk can anyone help?



I. (16 points)
Select the appropriate answer from the selection provided at the bottom of the page and write it out in the space provided.
_______________ 1. It has the address of the next instruction to be executed by the currently running process.
_______________ 2. A scheduling technique in which currently executing process yields its CPU time to a newly arrived higher priority process is
_______________ 3. It is a memory that is smaller and faster than main memory and that is
interposed between the processor and the main memory.
_______________ 4. In this communication scheme, the sender does not wait for the message to be received by the receiver.
_______________ 5. It is a data structure used to save the context of a process.
_______________ 6. It is technique used in CPU scheduling to address the starvation problem.
_______________ 7. It is a list of all processes in main memory waiting for execution.
_______________ 8. This is used to provide protection from illegal memory addressing.
Cache Asynchronous send
Program Counter Device Queue
Preemptive scheduling Aging
System Stack Ready Queue
Base & Limit Registers Process Control Block
Synchronous send Non-preemptive scheduling
II. (20 points)
a. Put these devices in order of access time from fastest to slowest (4 points)
- Use 1 for fastest & 4 for slowest
Main memory Registers Magnetic disk Cache
b. Put these devices in order of storage capacity from smallest to largest. (4 points)
- Use 1 for smallest & 4 for largest.
Main memory Registers Magnetic disk Cache
c. Indicate True or False for the following statements: (12 points)
i) Non-Privileged instructions can be executed in both user mode and kernel mode.
ii) A process performing a Blocking receive operation assumes a NULL
message and continues if there is no message on the link.
iii) Priority-based scheduling will not lead to starvation problem.
iv) A process is an active program in main memory.
v) A process can make a transition from Ready state to Terminated state.
vi) Round Robin scheduling is suitable for timeshared OS.
III. (14 points) Multiple Choice -Select the best answer for each of the following: circle the chosen option in the list and write your choice (an uppercase letter) in the space provided.
_____ 1. The purpose of multiprogramming is to:
A. develop an application using several programmers
B. make the computer hardware more user friendly
C. make it easy for the users to run programs
D. to get the most out of slow input-output devices
E. better utilize the CPU
_____ 2. In Many-to-One Thread Model
A. One user thread is mapped to many kernel threads
B. One kernel thread is mapped to many user threads
C. One kernel thread is mapped to many kernel threads
D. One user thread is mapped to many user threads
_____ 3. Concurrent execution of producer & consumer processes requires
A. a shared buffer
B. a synchronization requirement of buffer full check
C. a synchronization requirement of buffer empty check
D. choices (A) & (C)
E. choices (A) & (B) & (C)
_____ 4. The short-term scheduler
A. determines which jobs will be admitted to the system for processing
B. selects from the jobs in memory, which are ready to execute, and allocates the
CPU to one of them
C. is executed frequently and hence needs to be fast
D. choices (B) & (C).
_____ 5. The long-term scheduler (job scheduler) is responsible for
A. determining which jobs are to be admitted to the system for processing
B. selecting from the jobs in memory and allocating the CPU to one of them
C. selecting a good mix of I/O-bound and CPU-bound jobs
D. all of the above
E. choices (A) & (C).
F. choices (A) & (B).
_____ 6. Saving all the old CPU registers from one process and loading the CPU registers for a new
process happens during
A. swapping
B. context switching
C. partial execution
D. CPU utilization
_____ 7. Time-sharing is used for:
A. maximum utilization of CPU cycles and memory
B. charging the users for the use of computer time
C. making the system interactive to multiple users
D. choices (A) & (B)
IV. (8 points) Consider the following Thread class:
public class Bee extends Thread {
private int id; // thread id
public Bee (int id){
this.id=id;
}
public void run(){
while (true){
System.out.println("Buzz...Buzz...from bee " + id);
try{sleep(2000);}//sleep for 2 seconds
catch(InterruptedException e) {}
}
}
}
Show a Java code fragment for the following task:
First, instantiate an array object named Army consisting of sixty Bee objects.
Then, create & execute all the Bee threads in Army, assigning thread ids in the range 0 to 59.
V. 10 points) Java -- Use the following code to answer the next 8 questions
1. class threadPart extends Thread {
2. public threadPart(int a, int b){
3. size = 2*a + b;
4. }
5. public threadPart (int a) {
6. size = 3*a - 1;
7. }
8. public void run() {
9. Bunch = new int[size];
10. for (int i = 0; i
Select the perime was from the section vided at the bomen of the past and write is in the ce pred este des of the struction to see the lynning = 2 scheduling technique is which currently executing procesie ciety red higher priority proces is interpretes the more and the namemory 4 time, the windows for be receivedly 3. It is a structure the content of a ochnique wed in CPU scheduline to address the starvaton problem 7 Isaid of all processes in main memory waiting for securi * Thiele wed to pode pe from the main Program Case comotive wing Systems Stuk Base & Limit Register Schonend Asynchronouseet Device Quem Realy Ow Process Controllo Nome cheduling 11 Put these devices in order of time from fastest testem fie 4 Reyes Mapete di Puthe dolces in order of storage capacity from alles te largest points the former forest Many Register Magti did Indice True he do the following steel posto #Pecincan be the mode andere med Priest schedule will had to starvation plen Are can make a Rady Termited Hd Roble chedeling is for iOS doc 1. The use of app [- /Ming # A trip Ime.company cw 1) to get the most A. On a state as tatti 1. med fradu meget mere centra medio de = A sad buffer I offered Code Ich AAK Il choices 4 The sono Admin which we 11. CU cry Dicle The legemidler som blir A domingo de dla 1 4 hc 4A 12 4. FA Oppeg A. Bwin til Am C to come time Cming the theme IAS 1. pont. Conde de fong Thread class Ben That www. publice S. trip for ch Virat instamps an ed. As usual. Thir TNAN & checare all the Bes trai , 1. class that extends Thread 2. die threadrartite. Le 5.ble threadPartinta) 6. sie - - #pe void runt) Dunch new into) 10 Poesnt 1/1 si 12 13 for (int i = 1++! 14 35 Byster out peint buc) + 1 16 Byten out.print) 19 18 private int si 39 private in the 20 21 22 pslie lass mitt 23 public static void maintString 11 int. 25 theart new threader, 26 romer start 27 threadPart runner? new thread 20 ronnexetart 29 + L. Which of the rest Who de camera begirect 1. What the homme borterer What is the leafnan at line for the What is ne pe fondurite What is the permetre? PROCESS ARRIVAL TIME II DG at the precem desempen scheduling chiqw.hunter www. CDG ge Ga Ganesof de puce cheduling (538) dig technique. Determine the reader Dewa Gant chart of the proces scheduling pampeone SSIF scheduling Technique Determine the time when VH (12) Consider the following act of process in the ready quee whom using Round Robinport with me quase of 10 PROCESS CPL WIRST TIME 4. But they headed Desa Gune chose of the process schedule Determine the nating in process11. Bunch[i] = 3*i - 7;
12. }
13. for (int i = 0; i
14. System.out.print(Bunch[i] + );
15. }
16. System.out.println();
17. }
18. private int size;
19. private int[] Bunch;
20. }
21.
22.public class mainPart {
23. public static void main(String [] args) {
24. int m = 3; int n = 5;
25. threadPart runner1 = new threadPart(m, n);
26. runner1.start();
27. threadPart runner2 = new threadPart(n);
28. runner2.start();
29. }
30.}
1. Which line of code instantiates the runner1 object ? ______
2. Which line of code causes the runner1 thread to begin executing? ______
3. Which line of code instantiates the runner2 object ? ______
4. Which line of code causes the runner2 thread to begin executing? ______
5. What is the value of num at line 9 for the runner1 thread? ______
6. What is the value of num at line 9 for the runner2 thread? ______
7. What is the output from the runner1 thread? ______
8. What is the output from the runner2 thread? ______
VI. ( 20 points) Consider the following set of processes whose arrival times and CPU burst times are given:
PROCESS ARRIVAL TIME BURST TIME
A 0 10
B 5 3
C 3 6
D 6 5
(a) Draw a Gantt chart of the process scheduling using non-preemptive, Shortest Job First (SJF) scheduling technique. Determine the waiting time and turnaround time of each processes.
(b) Draw a Gantt chart of the process scheduling using preemptive, Shortest Job First (SJF) scheduling technique. Determine the waiting time and turnaround time of each processes.
VII. (12 points)
Consider the following set of processes in the ready queue whose arrival times are all 0. Assume that they are scheduled using Round Robin algorithm with a time quantum of 10.
PROCESS CPU BURST TIME
A 18
B 30
C 28
D 25
Draw a Gantt chart of the process schedule. Determine the waiting time and turnaround time of each processes.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
