PROCESS SCHEDULING

Experiment Number 1 : First Come First Serve


To view Simulator, Click Here

Software
System Requirements : Chrome Web Browser
Windows :
Download jar file from the link provided above and run it directly.
Linux :
Command line to download Chrome Web Browser :
sudo apt-get install chromium-browser
Command line to run jar file :
java -jar (filename).jar

Steps to use Simulator :

Consider the following example :
image

Step 1 : Download the jar file of the simulator from the link given above.

Step 2 : Once the jar file gets downloaded click to open it. The following window will appear.
img
Step 3 : This window contains many other sections which are Data, Job Pool, CPU, Ready Queue, Average(in sec) and Gantt Chart. They have their functionalities which will be discussed in next steps.
Step 4 : If user just wants to see the working of simulation, some of the inbuilt examples are already visible on the Job Pool table in the same window.
img
Step 5 : If the user wants to add his/her own data then click on "File" and then click on "Add my data" option in the header bar of the simulation.
img
Step 6 : When the user clicks on add my data, a new window appears with the help of which new entries for desired process can be added.
img
Step 7 : As per input table ,if arrival time of Process ID 1 is not 0 sec ,we keep our first job as a null job by keep all entries zero in that row.In that case, start filling entries in table from Process ID 2.
User also needs to enter the priority as per the scheduling algorithm. In this case, FCFS means the priority will be as per the arrival time of the processes. In the example given above, Arrival time 0 has priority 1, for arrival time 4 it will be 2, then for 5 it will be 3. Now there are two processes arriving at 6th second (if two processes arrive at same time)so priority is decided as per the ID of the process. Thus, on entering data in table, according to image given below process P3 will get higher priority than P5.
If we click on "Load Default" button then we can get random input data entries in the table.
After filling the final table,we click on the "Load Button".
img
Note : If arrival time of Process ID 1 is 0, then the entries will be filled in following manner in the table:
img
Step 8 : If arrival time of Process ID 1 is not 0 (as given in above example), then data entered will be displayed in the Job Pool with change in Process ID mentioned in column marked #.
img
Note : If arrival time of Process ID 1 is 0, then data entered will be displayed in the Job Pool mentioned in column marked #.
img
Step 9 : Now we have to fill the required Data from Data section.
img
Dropdowns and Buttons are :
Num of Jobs : It is used to select the default number of jobs when input is not provided.User can select from 2 to 8 processes. It reflects in the Job Pool.
Algorithm : To select which Algorithm needs to be used (FCFS, SJF, Round Robin, Preemptive Priority, Non-Preemptive Priority, SRTF).
Sim Speed : To set simulation speed (Generally advisable to set it at 2 sec).
Quantum : Set to 2 by default.
Simulate : To start the simulation.
Next Step : To display simulation in Gantt Chart section step by step.
Restart : To restart the entire simulation.
Start another simulation : To start new simulation.
Finish : To display entire simulation of Gantt Chart in Gantt Chart section at once.
Step 10 : Simulation is shown in the Gantt Chart window as follows with respective Process ID written on them which is given in Job Pool.
img
Step 11 : This CPU window shows the Current Job at each step. It also shows Current Time from which second to which second is the CPU performing the task given and also the Utilization of the CPU in percentage.
img
Step 12 : The Ready Queue window shows the upcoming processes with their respective process id written on them.
img
Step 13 : The average waiting time and average turnaround time in seconds is shown in the following window.
img
# Priority for different scheduling algorithms is as follows:
In FCFS, ascending order with respect to arrival time.
In SJF, the arrival time 0 will have first priority and then give priority according to the burst time in ascending order. Less burst time, high priority.
In Round Robin, arrival time in ascending order.
Priorities in case of Preemptive Scheduling and Non-Preemptive Scheduling will be given in the question itself.