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

TCO 2) Processes P1 and P2 each have a global variable x. Process P1 has threads

ID: 3907931 • Letter: T

Question

TCO 2) Processes P1 and P2 each have a global variable x. Process P1 has threads T1, T3, and T5, while process P2 has threads T2, T4, and T6. The following sequence of assignments is made by various threads in the order shown:
ThreadAssignment
T1x = 1;
T2x = 2;
T3x = 3;
T4x = 4;
T5x = 5;
T6x = 6;
If each thread now prints x, what value does each thread print?

Flag this Question

Question 1910 pts

(TCO 4) Consider a First Come First Served (FCFS) CPU scheduler with the following process profile:
Process Arrival Time CPU Burst
P1 t 5
P2 t+2 7
P3 t+4 3
P4 t+6 9
P5 t+8 1
P6 t+10 5
Assume that the CPU is idle and there are no other processes in the ready queue when process P1 arrives. Determine the schedule of process execution, and compute the wait times for each of the six processes. Which of the following is TRUE about the average wait time and the maximum wait time for the six processes?

Flag this Question

Question 2010 pts

(TCO 4) Consider the arrival time and CPU burst time statistics for the following six processes:
Process Arrival Time CPU Burst
P1 t 6
P2 t+1 2
P3 t+6 3
P4 t+9 7
P5 t+10 1
P6 t+13 5
Determine the schedule of process execution using the First Come First Served (FCFS) CPU scheduling algorithm. Which of the following is a FALSE statement about the wait times and turnaround times for the six processes?

T2 prints 5

Explanation / Answer

TCO2) x is the global variable and its last value set is 6. So every thread
will print 6.

TCO4)

P1 t 5     wait time = 0
P2 t+2 7   wait time = 3
P3 t+4 3   wait time = 8
P4 t+6 9   wait time = 9
P5 t+8 1   wait time = 16
P6 t+10 5 wait time = 14

avg wait time = 8.33
max wait time = 16

Correct option is third option


TCO4)

P1 t 6     ta time = 6
P2 t+2 7   ta time = 11
P3 t+4 3   ta time = 12
P4 t+6 9   ta time = 19
P5 t+8 1   ta time = 18
P6 t+10 5 ta time = 21

avg wait time = 8.33
max wait time = 16

option third is false