Wednesday, January 22, 2020

Tutorial 1 - Introduction on simulating scheduling algorithm

The main objective of ALExSIM (USAS), or simply USAS, is to help individual such as students (or even lecturers) to simulate or experimenting with the uniprocessor (process) scheduling algorithms. 

These algorithms are commonly studied in operating system subject/course, since process scheduling is one of the fundamental roles for the kernel as the core component (nucleus) of an operating system. 

To make it simple, we will not delve deep into the details about process scheduling here. But in this tutorial, we will learn about how to simulate the process scheduling algorithm named Round-Robin, using USAS. Once we have covered the steps, the same steps are applicable to test other scheduling algorithms currently supported in USAS.

STEP 1 - Setting up the process details for simulation.

The first thing to do is to prepare the simulation data, which are the process details. The required process details for the simulation include the following: 
  • process ID - normally a unique integer number to identify a running process. USAS will auto-generate the ID for each process. (Currently USAS can support or can generate only up to 60 processes in a single simulation, and will use alphabet instead of integer to represent ID)
  • burst time - this refers to the (estimated) length of time for a specific process to execute (from start until complete). 
  • arrival time - this refers to the (estimated) time a process will be loaded (arrive) for execution.
  • priority number - in real operating system, priority number will be given for each process, especially if the scheduler is using the priority-based scheduling (such as HPF). In USAS, these data are optional, except for the HPF algorithm.

USAS allows us to prepare the data (process details) in two ways - manually, or automatically generated using random values. By default USAS will show the latter option, which is to generate the data using random data, along with the default settings for the range of random values to be generated.

Options for data preparation (process details)

Click the Generate random values button to apply the default settings and generate the process details. Please note that user can also 
  • change/modify the default settings for the random value generation before clicking the Generate button.
  • regenerate the random values multiple times
(Optionally, if we already have our own process details, we may select the Manual Data Settings tab to prepare the empty table for the process details and fills up the details manually.)

STEP 2  (optional) - Editing the process details.

After the data generation, we should have the randomly generated data for the process details, such as the example shown below: (the process details table is located in section labelled 'Step 2 ...', just below the data generation button in the interface):

The Generate random button (above) and the list of processes with randomly generated details (below)
Optionally, except for the process ID, we may want to change/modify the generated values (by double-clicking any cell in the data table) to fulfill certain requirement. For example, if we need to ensure at least one of the arrival times for processes is 0, we just click and edit. If not necessary, then just use the generated data.

STEP 3 - Selecting the scheduling algorithm(s)

After we have prepared the process details, we need to select the scheduling algorithms to simulate.  The section is labelled 'Step 3 ...' and is located on the right-hand side of the interface. 

By default the First-Come-First-Serve algorithm is already selected. But since we want to simulate Round-Robin algorithm, we deselect the default option and select the Round-Robin. Round-Robin requires additional parameter which called the quantum time slice. Since we already provided with the default value quantum slice = 3, we just use it. USAS facilitates most of the steps with default options to allow easy preparation.

Selecting Round-Robin algorithm (above) and click the Run Simulate (below)

STEP 4 - Run the simulation.

Finally, after we have prepared all the data and settings we need, we click the Run Simulation button to perform the simulation and produce the following result, which will appear in the bottom section of the interface:

The result of Round-Robin algorithm simulation
There several outputs/results generated from the simulation. The most common results that we need are the average waiting time and the Gantt chart (in ASCII form or graphical). However USAS provides additional information such the turnaround time, waiting time and completion time for each process, and also the steps performed in the algorithm during the simulation. 

To summarize, following are the steps to use USAS:
  1. Generate the random process details or generate empty spaces for manual entry.
  2. Edit the process details.
  3. Select the scheduling algorithm.
  4. Run simulation and get results.


That's all for the basic tutorial of using ALExSIM (USAS).


No comments:

Post a Comment

Announcing the release of ALExSim-USAS version 1.0 (full version)

This is the announcement for the release of the new version of ALExSIM (USAS) ver 1.0 (full version) The release can be downloaded from ...