First Exam, Fall 2015 Problem 1. (25 Points) Assume that PA and PB are two distinctive programs. When PA is executed, it forks new processes executing PB at tick-marks 2 and 4. Assume that the execution of a process is divided into a sequence of CPU bursts by random disk I/O until it is done, and processes created by PA have a burst sequence of {3, 4} and processes created by PB have a burst sequence of {2, 3}. Assume that processes P 1 executing PA and process P 2 executing PB had arrived before t=0 in the order of {P 1, P 2 }. Draw a Gantt chart illustrating the scheduling if a round-robin scheduling with a time quantum of 3 is used. Assume that I/O requests will be handled in a FCFS manner and each I/O request can be completed within 4 ticks. Mark on the chart when a new process is arrived and when a process is requested an I/O. Problem 2. (25 Points) Assume that there are two processes had arrived before t=0 in the order of {P 1, P 2 }. Assume that each process was divided into a sequence of CPU bursts by random interrupts and the sequence of CPU bursts for given processes are specified as: P 1 : {2, 3} and P 2 : {3, 2}. Assume that (P 1 )=.5 and (P 2 )=.55. Use the following formula to evaluate n+1, the (n+1)th estimated burst time: time will be scheduled to use the CPU. Draw a Gantt chart illustrating this scheduling. Problem 3. (25 Points) Assume that each process fan-outs a number of threats and each threat is executed as a sequence of bursts, called micros, and the execution of a micro is counted in flashes. We assume that when a process is scheduled, its threats are executed in a priority scheduling manner and each threat can only be scheduled once within each timequantum. Assume that within each process the order of priorities is the same as the listing order of threats, i.e. the first threat has the highest priority. When a process has no more threat to run then it will be pre-empted and the next scheduled process will be started at the beginning of the next tick-mark. Assume that each tick is divided into 8 flashes and each threat can be described as a set of {[micros * flashes]}. Assume that three processes had arrived before t=0 in the order of {P 1, P 2, P 3 }: P 1 is defined as a set of {[2*2], [2*2], [1*3]}; P 2 is defined as a set of {[2*3], [1*2], [2*3]}; P 3 is defined as a set of {[2*2], [2*4]}. Draw a Gantt chart illustrating the scheduling if a round-robin scheduling with a time quantum = 1 tick is used.
First Exam, Spring 2015 Problem 1. (30 Points) Assume that all three processes have arrived before t=0 in the order of {P 1, P 2, P 3 }. Assume that each process was divided into a sequence of CPU bursts by random interrupts and the sequences of CPU bursts for given processes are specified as: P 1 : {3, 2, 4}, P 2 : {2, 4, 3}, and P 3 : {4, 3, 2}. Assume that (P 2 )=.45, (P 2 )=.55 and (P 3 )=.5. Use the following formula to evaluate n+1, the (n+1)th estimated burst time: Problem 2. (35 Points) Assume that each process fan-outs a number of threats and each threat is executed as a sequence of bursts, called micros, and the execution of a micro is counted in flashes. We assume that when a process is scheduled, its threats are executed in a round-robin manner and each threat can only be scheduled once within each timequantum. When a process has no more threat to run then it will be pre-empted and the next scheduled process will be started at the beginning of the next tick-mark. Assume that each tick is divided into 8 flashes and each threat can be described as a set of {[micros * flashes]}. Assume that three processes had arrived before t=0 in the order of {P 1, P 2, P 3 }: P 1 is defined as a set of {[5*4], [3*3], [4*4]}; P 2 is defined as a set of {[3*4], [5*4], [4*3]}; P 3 is defined as a set of {[5*4], [5*4]}. Draw a Gantt chart illustrating the scheduling if a round-robin scheduling with a time quantum = 2 ticks is used. Problem 3. (35 Points) Assume that PA and PB are two distinctive programs. When PA is executed, it forks new processes executing PB at tick-mark 4 and 7. Assume that the execution of a process is divided into a sequence of CPU bursts by random disk I/O until it is done, and processes created by PA have a burst sequence of {3, 2, 4} and processes created by PB have a burst sequence of {2, 3, 2}. Assume that two processes P 1 and P 2, both executing PA, had arrived before t=0. Draw a Gantt chart illustrating the scheduling if a round-robin scheduling with a time quantum of 3 is used. Assume that I/O requests will be handled in a FCFS manner and each I/O request can be completed within 4 ticks. Mark on the chart when a new process is forked and a process has done its execution.
First Exam, Fall 2014, Problem 1. (35 Points) Assume that PA and PB are two distinguished programs. When PA is executed, it needs 10 ticks to complete its execution and it forks new processes executing PB at tick-marks 2, 4 and 7. Similarly, PB needs 5 ticks to complete its execution and it forks a new process executing PB at tick-mark 2. Assume that two processes P1 and P2 have arrived before t=0 and P1 is executing program PA while P2 is executing PB. Draw a Gantt chart illustrating the scheduling of these processes until P1 is done assume that a round-robin scheduling with a time quantum of 4 is used. Problem 2. (20 Points) Assume that we have a computer system which is using both priority scheduling and round-robin scheduling. Assume that each background process has a priority of 5; and a foreground process has a higher priority of 0 but its priority will drop 1 after each tick of execution until its priority returns to the lowest of 5. Assume that we set the current running process as a foreground process at t=8 and then every 17 ticks after that. Assume that a background process has a time-quantum of 3 ticks; and if it is becoming foreground the process will continue to execute until its priority drops to 5. Assume that we have 4 processes {P 1, P 2, P 3, P 4 } before t=0 and each of them has an identical burst-time of 20. Draw a Gantt chart illustrating the scheduling. Problem 3. (30 Points) Assume that each process was divided into a sequence of CPU bursts by random interrupts. Assume that all three processes have arrived before t=0 in the order of {P 1, P 2, P 3 }. Assume that their sequences of CPU bursts are specified as: P 1 : {3, 4}, P 2 : {2, 5}, and P 3 : {5, 4}. Assume that these processes have the same value of.5. Use the following formula to Problem 4. (15 Points) Assume that all the processes are running long enough to be considered as they can execute forever. Assume that all these N processes are grouped into two families, with N > 3. Family A contains only one process {P i } and Family B contains the rest of the processes; and i can be any number between 1 and N. Assume that all the processes in Family B will share 1/3 of the CPU time while the process in Family A takes the rest of the CPU time; i.e. Pi uses 2/3 the CPU time and each of the rest of processes uses 1/(3(N-1)). How to make this scheduling work? Hint: you can use priority. No, UNIX s Fair Share Scheduling method cannot be used.
First Exam, Spring 2014, Problem 1. (40 Points) Assume that each process fan-outs a number of threats and each threat is executed as a sequence of sub-bursts; and we assume that when a process is scheduled, its threats are executed in a round-robin manner and each threat can only be scheduled once within each time-quantum. When a process has no more threat to run then it will be pre-empted and the next scheduled process will be started at the beginning of the next tick. Assume that each tick is divided into 10 flashes. Let us call segments of a subburst a micro and the execution of a micro is counted in flashes. Assume that P 1, P 2 and P 3 are three distinctive processes and each can be described as a set of {[n*m]} where n is the number of micros and m is burst-time in flashes: P 1 is defined as a set of {[6*3], [3*5], [5*4]}; P 2 is defined as a set of {[5*4], [6*5], [3*4]}; P 3 is defined as a set of {[7*3], [7*3]}. Assume that all three processes had arrived before t=0 in the order of {P 1, P 2, P 3 }. Draw a Gantt chart illustrating the scheduling if a round-robin scheduling. Problem 2. (35 Points) Assume that each process was divided into a sequence of CPU bursts by random interrupts. Assume that all three processes had arrived before t=0 in the order of {P 1, P 2, P 3 }. Assume their sequences of CPU bursts are specified as: P 1 : {5, 4, 2}, P 2 : {4, 6, 3}, and P 3 : {3, 5, 4}. Assume that these processes have the same value of.4. Use the following formula to and t o =0 and o =5 for all processes. Draw a Gantt chart illustrating the scheduling if a *predicted* Shortest Job First scheduling is used. Problem 3. (25 Points) Assume that we have a customized personal computer which is using both priority scheduling and round-robin scheduling schema. Assume that each background process has a priority of Regular and a time-quantum of 2 ticks; and a foreground process has a higher priority of Higher and a longer time-quantum of 5 ticks. Assume that we have 4 processes {P 1, P 2, P 3, P 4 } in this system before t=0 and each of them has a burst-time longer enough to be considered as they can run forever. Assume that we randomly choose the current executing process becomes a foreground processes every 13 ticks after t=0. The selected process will jump to Higher queue and it gets an extra 3 ticks of execution as the time quantum becomes longer; and it will return to the Regular queue after it is time-out. Draw a Gantt chart illustrating the scheduling.
First Exam, Fall 2014, Name: The page is the cover page to your answer sheets and show your work. Problem 1. (35 Points) Assume that PA and PB are two distinguished programs. When PA is executed, it needs 10 ticks to complete its execution and it forks new processes executing PB at tick-marks 2, 4 and 7. Similarly, PB needs 5 ticks to complete its execution and it forks a new process executing PB at tick-mark 2. Assume that two processes P1 and P2 have arrived before t=0 and P1 is executing program PA while P2 is executing PB. Draw a Gantt chart illustrating the scheduling of these processes until P1 is done assume that a round-robin scheduling with a time quantum of 4 is used. Problem 2. (20 Points) Assume that we have a computer system which is using both priority scheduling and round-robin scheduling. Assume that each background process has a priority of 5; and a foreground process has a higher priority of 0 but its priority will drop 1 after each tick of execution until its priority returns to the lowest of 5. Assume that we set the current running process as a foreground process at t=8 and then every 17 ticks after that. Assume that a background process has a time-quantum of 3 ticks; and if it is becoming foreground the process will continue to execute until its priority drops to 5. Assume that we have 4 processes {P 1, P 2, P 3, P 4 } before t=0 and each of them has an identical burst-time of 20. Draw a Gantt chart illustrating the scheduling. Problem 3. (30 Points) Assume that each process was divided into a sequence of CPU bursts by random interrupts. Assume that all three processes have arrived before t=0 in the order of {P 1, P 2, P 3 }. Assume that their sequences of CPU bursts are specified as: P 1 : {3, 4}, P 2 : {2, 5}, and P 3 : {5, 4}. Assume that these processes have the same value of.5. Use the following formula to Problem 4. (15 Points) Assume that all the processes are running long enough to be considered as they can execute forever. Assume that all these N processes are grouped into two families, with N > 3. Family A contains only one process {P i } and Family B contains the rest of the processes; and i can be any number between 1 and N. Assume that all the processes in Family B will share 1/3 of the CPU time while the process in Family A takes the rest of the CPU time; i.e. Pi uses 2/3 the CPU time and each of the rest of processes uses 1/(3(N-1)). How to make this scheduling work? Hint: you can use priority. No, UNIX s Fair Share Scheduling method cannot be used.