

All the processes should run at least for 1min. Students would like to refer tothe following C-library function and system call: sprintf, open,write, close. Print out all the operations to thefollowing file: schedule_dump.txt. Print out the scheduling operations in the following format: (attime t, process pid gets CPU time, remaining CPU-burst) run-queuedump, wait-queue dump. (so that it can be scheduled after I/O completion)The scheduling is triggered by several events, for example: theexpiry of time quantum (of a process), process makes I/O request(completing CPU-burst). (for all the processes inthe wait-queue) When the remaining I/O-burst value of a processreaches to zero, the parent process puts the child process back tothe run-queue. Whenever time tick occurs, the parentprocess decreases the I/O-burst value. (so that the child cannot get scheduleduntil it finishes I/O) The parent process should remember I/O-burstvalue of the child process. Then, the schedulertakes the child process out of the run-queue, and moves the childprocess to the wait-queue. The parent process receives IPC message from a child process, itchecks whether the child begins I/O-burst. If CPU-burst reaches tozero, the child sends IPC message to the parent process with thenext I/O-burst time. To simulate this,child accounts for the remaining CPU-burst. When the child process takes IPC messagefrom msgq, it decreases CPU-burst value.Ĭhildren makes I/O requests after CPU-burst. To simulate this,the child process makes progress when it is in CPU-burst phase.Besides, the parent process sends IPC message to the currentlyrunning child process. When a user process receives the timeslice from OS, the user process makes progress. Theexecution begins with two parameters: (cpu_burst, io_burst). Workloadconsists of infinite loop of dynamic CPU- burst and I/O-burst. The parent processaccounts for the waiting time of all the child processes.Ī child process simulates the execution of a user process.

The parent process gives timeslice to the child process by sending IPC message through msgq.Students may want to refer to msgget, msgsnd, msgrcv system calls.Please note that there is IPC_NOWAIT flag. The parent process performs scheduling of its childprocesses: The parent process accounts for the remaining timequantum of all the child processes. Wait-queue holds child processes that are not in readystate. Run-queue holds child processes that are readystate. The parent process maintains run-queueand wait-queue. The ALARM signal serves as periodic timerinterrupt (or time tick). On a first note lets discuss about the algorithm i.e the technicality behind the simulator.We are taking the no of processes, arrival time and burst time as the input to the simulator.
LAB SCHEDULING ROUND ROBIN WITH A TIMESLICE OF 4 TICKS SIMULATOR
Students may want to refer tosetitimer system call. The job scheduling simulator has been designed based on the cpu scheduling algorithms like FCFS (first come first serve), round robin and priority scheduling algorithm. Parent process periodically receives ALARMsignal by registering timer event. Assume your own scheduling parameters: e.g.

slices in a form of preemptive scheduling, such that each child gets one time slice in a round robin way. Parent processschedules child processes according to the round-robin schedulingpolicy. for round-based scheduling of time slices. > approaches the turnaround time for CPU-bound processes!ħ.Create 10 child processes from a parent process. > service time = turnaround time - waiting time service time: the time spent servicing the job i.e.

waiting time: the time spent waiting in the ready queue before job completionĦ. > turnaround time = wait time + service timeĥ. turnaround time: the time it takes to complete a job, computed as the wall clock time elapsed between completion and arrival events throughput: the number of jobs completed per unit of timeĤ. > total work = useful work + overhead work (smaller overhead, closer to 100% efficiency)ģ. efficiency: useful work divided by total work (because even if CPU is utilized 100%, it's meaningless if the work it's doing is not real work e.g. CPU utilization: a percentage reflecting the capacity used divided by the total capacity (100% = completely used 0% = not used at all, e.g.
