Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

last four digits of IDs: Fall 2017 Midterm Exam Name: A. b, c, d B. b, d C. c,d

ID: 3598916 • Letter: L

Question

last four digits of IDs: Fall 2017 Midterm Exam Name: A. b, c, d B. b, d C. c,d D. c,e E. c, d, e 2. (12) For each of the following statements indicate whether it is true or false, and give a one-sentence justification (3 points for each). a. A process is a program into the ready queue. tasks that they carry out. b. CPU scheduler is a long-term scheduler which selects which processes should be brought c. Time-Sharing system executes programs that are guaranteed to have an upper bound orn d. Round-robin scheduling never results in more context switches than FCFS. 3. (20) Explain what will be output for the following program? # include #include #include «unistd.h> int value 5 int main0 pid t pid; pid-forkO ifpid -0) printf("I am the child process. In") value+ 15; else if (pid>0) wait (NULL); printf"I am the parent process, value-od ", value) exit(0) 4. (23) Consider the following set of processes, with the length of the CPU burst given in milliseconds: Process Burst Times Pl P2 P3 P4 Ps Priority 10 The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0

Explanation / Answer

2.

a) False

Explanation- A process is an instance of a program. A program may consist of many processes.

b) False

Explanation- Short term scheduler is called the CPU scheduler, it selects a process among the processes ready to be executed and allocates CPU to one of these processes.

c) False

Explanation- A real time system executes program that are guaranteed to have an upper bound on task that they carried out.

d) True

Explanation- Round Robin scheduling is a preemptive scheduling algorithm which has more context switching than FCFS.