CPU SCHEDULING ALGORITHMS
Posted on 2004-04-19
I would like to write a programme of a process scheduling system that have three queues [SJF,Round Robin RR, and FCFS]. I do have a file of list of processes with the following attribuates [processes ID, burst time, start time, n file size] to be inserted in the three queues. a process is placed in a queue when its start time is >= to the clock time. The CPU attempts to read the processes in the following order :-
i) Execute all processes in SJF-Q first.
ii) If SJF-Q is empty then execute all processes in RR-Q. If a new job is entered into SJF-Q then
once the existing RR-Q job finishes, or completes it’s quantum, RR-Q cannot access the
CPU until all the processes in SJF-Q have been completed.
iii) Likewise processes in FCFS-Q can start once SJF-Q and RR-Q are empty, although if a new job
is placed into SJF-Q or RR-Q then upon completion of the current job (from FCFS-Q) in the
CPU, FCFS-Q cannot access to the CPU until both SJF-Q and RR-Qare empty again.
The queue where a process should go is determined by its burst time.
I need also to compute the average waiting time of the processes to start over the entire 3 Qs . and also an average waiting time of each queue.
please I need hints on how to implement the code. I'm lost and I donn't know how to start.
Thank you very much