First Exam, Spring 2017, Problem 1. (35 Points) Assume that P A, P B and P C are three distinctive programs. When P A is executed, it forks new processes executing P B at tick-marks 2, 5 and 7 and its burst time is 8; and when P B is executed, it forks a new process executing P C at tick-mark 2. Assume that the execution of both P B and P C are divided into sequences of CPU bursts by I/O requests. Assume that each I/O request can be completed within 3 ticks and all I/O requests are handled in a FCFS manner. Assume that a process running P B has a burst sequence of {4, 2} and a process running P C has a burst sequence of {2, 2}. Assume that two processes P 1 and P 2 have arrived before t=0 and P 1 is executing P A while P 2 is executing P B. Draw a Gantt chart illustrating the scheduling if a R.R. scheduling with a TQ=3 ticks is used. Mark on the chart when a new process is arrived. Problem 2. (5 Points) Extra condition for the Problem 1. Assume that a soft interrupt is caught by P 4 at t=15, when this interrupt will be handled? Problem 3. (20 Points) Assume that a file was opened and the byte-offset 8806600 (8806600 = 8600*1024 + 200) is accessed. Note that. Assume that the read/write header of the hard drive is currently located at track #123 with block #654. Assume that each track of the targeted HD contains 4096 blocks and data blocks that are associated with the targeted block are a sequence of blocks starts at virtual block #345678 (84*4096 + 1614) and each additional block is 100000 (24*4096 + 1696) blocks away. Assume that both and are given as 1 microsecond ( s). How many milliseconds (ms) are needed to load the targeted block into buffer-cache and how many blocks are directly accessed? Note that we assume that all the blocks that are involved are not used beforehand.
First Exam, Fall 2016, Problem 1. (35 Points) Assume that P A and P B are two distinctive programs. When P A is executed, it forks new processes executing P B at tick-marks 2 and 4. Assume that the execution of a process is divided into a sequence of CPU bursts by I/O requests until it is done; and assume that each I/O request can be completed within 3 ticks and I/O requests are handled in a FCFS manner. Assume that the processes running P A have a burst sequence of {3, 2, 2} and the processes running P B have a burst sequence of {2, 3}. Assume that three processes P 1, P 2 and P 3 have arrived before t=0; and P 1 is executing P B while both P 2 and P 3 are executing P A. Draw a Gantt chart illustrating the scheduling if a FCFS scheduling is used. Mark on the chart when a new process is arrived. Problem 2. (5 Points) Extra condition for the Problem 1. Assume that a soft interrupt is caught by P 4 at t=13, when this interrupt will be handled? Problem 3. (5 Points) Why the estimated SJF scheduling method will not performed well if the involving processes could not effectively divided into sequences of CPU bursts? Problem 4. (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 FCFS manner and each threat can only be scheduled once within each time-quantum. When a process has no more threat can be run then it will be pre-empted; and the next process will be scheduled at the beginning of the next tick-mark if the remaining tick is less than 4 flashes and the OS will performs a context switch at the end of each TQ no matter what. 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*5], [2*3]}; P 2 is defined as a set of {[2*2], [2*4]}; P 3 is defined as a set of {[2*5], [1*4], [2*3]}. quantum = 1 tick is used.
First Exam, Spring 2016, Problem 1. (40 Points) Assume that P A and P B are two distinctive programs. When P A is executed, it forks new processes executing P B at tick-marks 2, 4 and 6. Assume that the execution of a process is divided into a sequence of CPU bursts by random interrupts until it is done, and processes created by P A have a burst sequence of {3, 4} and processes created by P B have a burst sequence of {2, 2}. Assume that two processes P 1 and P 2 have arrived before t=0; and both executing P A. Draw a Gantt chart illustrating the scheduling if a FCFS scheduling is used. Mark on the chart when a new process is arrived. Problem 2. (20 Points) Assume that there are three processes had 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 sequence of CPU bursts for given processes are specified as: P 1 : {3, 4}, P 2 : {2, 5}, and P 3 : {2, 4}. Assume that (P 1 )=0.3, (P 2 )=0.5 and (P 3 )=0.7. Use the following formula to evaluate n+1, the (n+1)th estimated burst time: where t o =0 and o =10 for all processes. The process with the shortest estimated burst time will be scheduled to use the CPU. Draw a Gantt chart illustrating this scheduling. Problem 3. (10 Points) Assume that a given hard disk is running at 12,000 rpm, and the speed of the step motor is 1 micro-second per 2 tracks and each track contain 5000 blocks. Assume that there are two I/O requests arrived before t=0: 1st one asking for a read operation on block #457386 and the 2nd one asking for a writing operation on block #743253. Assume that the read/write header is located at track #37 and block #500 at t=0. Assume that the device is running in a first come first serve manner. Compute the time needed to finish these two I/O. Note: you need to calculate the track # and block # for each targeted block.
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: where t o =0 and o =5 for all processes. The process with the shortest estimated burst 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]}. 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: where t o =0 and o =5 for all processes. The process with the shortest estimated burst time will be scheduled to use CPU. Draw a Gantt chart illustrating this scheduling. 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 roundrobin 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-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]}. 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.