Вы находитесь на странице: 1из 3

Faculty of computers and Informatics Suez Canal University

Operating System, 2011 4th Year, CS Dep.

Process and scheduling

1- Develop a small program in C (or Java) using system calls or any others (e.g. fork(), waitpid(), exit(), kill(), ..) that does the following: a parent process creates a child process that prints its PID the child creates a grandchild and sleeps 120 seconds the grandchild immediately exits the parent sleeps for 60 seconds and then kills all the processes 2Given the following mix of job, job lengths, and arrival times, assume a time slice of 10 and compute the completion and average response time of each job for the FIFO, RR, and SRTF algorithms. Use the following format for the solution:


3Given the following set of processes, compute the average turnaround time and waiting time for the specified scheduling algorithms. Process Burst Time ---------------P1 10 P2 4 P3 6 P4 12 The processes are assumed to have arrived in the order P1, P2, P3, P4 at time 0. Also, note that the "context switch time is 1". Using FCFS, Round Robin with Time Slice = 6.

4-

Consider the following set of processes, with the length of the CPU-burst time given in milliseconds. Process Burst time ---------------P1 10 P2 1 P3 2 P4 1 P5 5 The processes are assumed to have arrived in the order P1,P2,P3,P4,P5, all at time 0. Draw two Gantt charts illustrating the execution of these processes using FCFS and a nonpreemptive SJF scheduling. Calculate waiting times and turnaround times for each process, and the average waiting times and average turnaround times for both scheduling.

Consider the following set of processes, with the arrival times and the length of the CPU-burst time given in milliseconds. Process Arrival time Burst time --------------------------P1 0 10 P2 2 1 P3 3 2 P4 4 1 P5 6 5 Draw two Gantt charts illustrating the execution of these processes using nonpreemptive SJF and preemptive SJF scheduling.Calculate waiting times and turnaround times for each process, and the average waiting times and average turnaround times for both scheduling.

5-

6-

Consider the following set of processes, with the the length of the CPU-burst time given in milliseconds and the priorities given so that smaller priority number means a higher priority.

Process Burst time Priority ----------------------P1 10 3 P2 1 1 P3 2 3 P4 1 4 P5 5 2 The processes are assumed to have arrived in the order P1,P2,P3,P4,P5, all at time 0. Draw a Gantt chart illustrating the execution of these processes using a priority scheduling. (Use FCFS for equal priority processes) Calculate waiting times and turnaround times for each process, and the average waiting time and average turnaround time for this scheduling.

7-

Consider the following set of processes, with the arrival times and the length of the CPU-burst time given in milliseconds. Process Arrival time Burst time --------------------------P1 0.0 8 P2 0.4 4 P3 1.0 1 Draw two Gantt charts illustrating the execution of these processes using FCFS and a nonpreemptive SJF scheduling. Calculate waiting times and turnaround times for each process, and the average waiting times and average turnaround times for both scheduling. What happens in the previous task (task number 7) if the CPU is forced to be idle for 1 ms at the beginning (from 0 ms to 1 ms) and then a nonpreemptive SJF is used? Draw a Gantt chart for scheduling. Calculate waiting times and turnaround times for each process, and the average waiting time and average turnaround time for this scheduling.

8-

Вам также может понравиться