-
for
time tester
(waitx) command wtime and rtime includes only running and waiting time fortime
process not for fork running in it thats why i printed there individual finishing time (total time) -
although wtime, rtime and total_time for
time tester
in each scheduling are mentioned belowflag wtime rtime s_time total_time RR 3 17 24355 2455 FCFS 5 1 4220 4226 PBS 6 15 2422 2444 MLFQ 5 1 2404 2410 total time = waiting_time + running_time + sleeping_time -
order on basis of finishing time
FCFS >> RR > PBS > MLFQ
a huge difference in FCFS and other is due to non-preemitive implementation in FCFS
-
FCFS has largest finishing time as there is no preemption and if a process with larger time comes first all the rest processes have to starve for cpu execution.
-
PBS and RR have almost same finishing time. In PBS is any two and more processes are given same priority then they would also act as FCFS but with preemption and in RR after every particular time slice so not process would starve for CPU. Thus, both have less finishing time is than FCFS.
-
MLFQ has the least time as there are many queues with different priorities and a process which takes more CPU time is shifted to less priority queue and also prevents starvation by aging i.e shifting to upper queues after some fixed time. Thus, it takes the least time.
- As asked in point 5 of procedure, If a process voluntarily relinquishes control of the CPU, it leaves the queuing network, and when the process becomes ready again after the I/O, it is inserted at the tail of the same queue, from which it is relinquished earlier. This can be exploited by a process, as just when the time-slice is about to expire, the process can voluntarily relinquish control of the CPU, and get inserted in the same queue again. If it ran as normal, then due to time-slice getting expired, it would have been preempted to a lower priority queue. The process, after exploitation, will remain in the higher priority queue, so that it can run again sooner that it should have. In the other words a process can ensure to remain in higher priority queue by increasing the number of I/O processes (for example printing garbage on the terminal).
- graph for running
tester_mlfq
- files changed
- proc.c
- proc.h
- trap.c
- defs.h
- syscall.c
- syscall.h
- sysproc.c
- user.h
- usys.S
- added testers files
- time.c
- tester.c
- tester_ps.c
- tester_pbs.c
- tester_mlfq.c
- setPriority.c
- README.md
- code description
- REPORT.md
- question asked
- graph
- Others
- graph_log_unfilter.txt
- graph_log.txt
- graph.png
- RRt.png
- FCFSt.png
- PBSt.png
- MLFQt.png