1/22 Design and Development of a CPU Scheduler Simulator for Educational Purposes Using SDL Manuel Rodr´ ıguez- Cayetano Summary CPU Scheduling Overview The SDL CPU Scheduler Simulator The CPU Scheduler Simulator Graphical User Interface Conclusions and Further Work Design and Development of a CPU Scheduler Simulator for Educational Purposes Using SDL Manuel Rodr´ ıguez-Cayetano Department of Signal Theory and Telematics Engineering University of Valladolid, ES-47011 Valladolid, Spain [email protected]6th Workshop on System Analysis and Modelling Oslo, October 4th-5th 2010
58
Embed
Design and Development of a CPU Scheduler Simulator for ...
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Design and Development of a CPU SchedulerSimulator for Educational Purposes Using SDL
Manuel Rodrıguez-Cayetano
Department of Signal Theory and Telematics EngineeringUniversity of Valladolid, ES-47011 Valladolid, Spain
6th Workshop on System Analysis and ModellingOslo, October 4th-5th 2010
2/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Summary
1 CPU Scheduling OverviewCPU Scheduling BasicsRelated work
2 The SDL CPU Scheduler SimulatorRequirementsBehavior OverviewSimulator structureDetailed Behavior
3 The CPU Scheduler Simulator Graphical User Interface
4 Conclusions and Further Work
2/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Summary
1 CPU Scheduling OverviewCPU Scheduling BasicsRelated work
2 The SDL CPU Scheduler SimulatorRequirementsBehavior OverviewSimulator structureDetailed Behavior
3 The CPU Scheduler Simulator Graphical User Interface
4 Conclusions and Further Work
2/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Summary
1 CPU Scheduling OverviewCPU Scheduling BasicsRelated work
2 The SDL CPU Scheduler SimulatorRequirementsBehavior OverviewSimulator structureDetailed Behavior
3 The CPU Scheduler Simulator Graphical User Interface
4 Conclusions and Further Work
2/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Summary
1 CPU Scheduling OverviewCPU Scheduling BasicsRelated work
2 The SDL CPU Scheduler SimulatorRequirementsBehavior OverviewSimulator structureDetailed Behavior
3 The CPU Scheduler Simulator Graphical User Interface
4 Conclusions and Further Work
2/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Summary
1 CPU Scheduling OverviewCPU Scheduling BasicsRelated work
2 The SDL CPU Scheduler SimulatorRequirementsBehavior OverviewSimulator structureDetailed Behavior
3 The CPU Scheduler Simulator Graphical User Interface
4 Conclusions and Further Work
2/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Summary
1 CPU Scheduling OverviewCPU Scheduling BasicsRelated work
2 The SDL CPU Scheduler SimulatorRequirementsBehavior OverviewSimulator structureDetailed Behavior
3 The CPU Scheduler Simulator Graphical User Interface
4 Conclusions and Further Work
2/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Summary
1 CPU Scheduling OverviewCPU Scheduling BasicsRelated work
2 The SDL CPU Scheduler SimulatorRequirementsBehavior OverviewSimulator structureDetailed Behavior
3 The CPU Scheduler Simulator Graphical User Interface
4 Conclusions and Further Work
2/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Summary
1 CPU Scheduling OverviewCPU Scheduling BasicsRelated work
2 The SDL CPU Scheduler SimulatorRequirementsBehavior OverviewSimulator structureDetailed Behavior
3 The CPU Scheduler Simulator Graphical User Interface
4 Conclusions and Further Work
2/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Summary
1 CPU Scheduling OverviewCPU Scheduling BasicsRelated work
2 The SDL CPU Scheduler SimulatorRequirementsBehavior OverviewSimulator structureDetailed Behavior
3 The CPU Scheduler Simulator Graphical User Interface
4 Conclusions and Further Work
2/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Summary
1 CPU Scheduling OverviewCPU Scheduling BasicsRelated work
2 The SDL CPU Scheduler SimulatorRequirementsBehavior OverviewSimulator structureDetailed Behavior
3 The CPU Scheduler Simulator Graphical User Interface
4 Conclusions and Further Work
3/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
CPU SchedulingBasics
Related work
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
CPU Scheduling Basics (I)
CPU scheduling: deciding which of the ready processes isto be allocated the CPU
Different selection criteria ⇒ different schedulingalgorithms
Two types of scheduling algorithms:
one queue algorithms: appropriate when all the processesbelong to the same class (same scheduling requirements)multilevel queue algorithms: appropriate for processesbelonging to several classes (different schedulingrequirements)
Every algorithm may favor one class of process overanother due its properties:
performance evaluation parameters (throughput,turnaround time, waiting time, . . . ) are used for comparingCPU scheduling algorithms
3/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
CPU SchedulingBasics
Related work
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
CPU Scheduling Basics (I)
CPU scheduling: deciding which of the ready processes isto be allocated the CPU
Different selection criteria ⇒ different schedulingalgorithms
Two types of scheduling algorithms:
one queue algorithms: appropriate when all the processesbelong to the same class (same scheduling requirements)multilevel queue algorithms: appropriate for processesbelonging to several classes (different schedulingrequirements)
Every algorithm may favor one class of process overanother due its properties:
performance evaluation parameters (throughput,turnaround time, waiting time, . . . ) are used for comparingCPU scheduling algorithms
3/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
CPU SchedulingBasics
Related work
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
CPU Scheduling Basics (I)
CPU scheduling: deciding which of the ready processes isto be allocated the CPU
Different selection criteria ⇒ different schedulingalgorithms
Two types of scheduling algorithms:
one queue algorithms: appropriate when all the processesbelong to the same class (same scheduling requirements)multilevel queue algorithms: appropriate for processesbelonging to several classes (different schedulingrequirements)
Every algorithm may favor one class of process overanother due its properties:
performance evaluation parameters (throughput,turnaround time, waiting time, . . . ) are used for comparingCPU scheduling algorithms
3/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
CPU SchedulingBasics
Related work
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
CPU Scheduling Basics (I)
CPU scheduling: deciding which of the ready processes isto be allocated the CPU
Different selection criteria ⇒ different schedulingalgorithms
Two types of scheduling algorithms:
one queue algorithms: appropriate when all the processesbelong to the same class (same scheduling requirements)multilevel queue algorithms: appropriate for processesbelonging to several classes (different schedulingrequirements)
Every algorithm may favor one class of process overanother due its properties:
performance evaluation parameters (throughput,turnaround time, waiting time, . . . ) are used for comparingCPU scheduling algorithms
4/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
CPU SchedulingBasics
Related work
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
CPU Scheduling Basics (II)
Selecting an algorithm appropriate for a process workload⇒ evaluation of the algorithms based on values of theperformance evaluation parameters
for example, select the algorithm that produces the leastmean waiting time for a process workload
Several evaluation methods:
deterministic modeling: results only valid for the concrete(deterministic) workload usedqueuing models based: classes of algorithms and statisticaldistributions of process parameters limited, results notaccuratesimulation: can support deterministic and statistical basedworkloads, results can be more accurate than thoseobtained using queuing models
4/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
CPU SchedulingBasics
Related work
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
CPU Scheduling Basics (II)
Selecting an algorithm appropriate for a process workload⇒ evaluation of the algorithms based on values of theperformance evaluation parameters
for example, select the algorithm that produces the leastmean waiting time for a process workload
Several evaluation methods:
deterministic modeling: results only valid for the concrete(deterministic) workload usedqueuing models based: classes of algorithms and statisticaldistributions of process parameters limited, results notaccuratesimulation: can support deterministic and statistical basedworkloads, results can be more accurate than thoseobtained using queuing models
5/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
CPU SchedulingBasics
Related work
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
CPU Scheduling Basics (III)
Simulation consist of programming a model of thecomputer system that behaves like the actual system (atleast regarding CPU scheduling) ⇒ modeling:
arrival, ready and finished queuesclock. . .
Design, coding and debugging of a simulator are usually amajor task
appropriate specification techniques (like SDL) should beused instead of just coding
5/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
CPU SchedulingBasics
Related work
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
CPU Scheduling Basics (III)
Simulation consist of programming a model of thecomputer system that behaves like the actual system (atleast regarding CPU scheduling) ⇒ modeling:
arrival, ready and finished queuesclock. . .
Design, coding and debugging of a simulator are usually amajor task
appropriate specification techniques (like SDL) should beused instead of just coding
6/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
CPU SchedulingBasics
Related work
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Related work and motivation
Several CPU scheduling simulators have been previouslydeveloped: CPU Scheduling Simulator, CPU SchedulerApplication, Process Scheduling Simulator, MOSSScheduling Simulator . . .
Main shortcomings of these simulators:
algorithms specific for real-time processes are not supportedmultilevel queue algorithms are not supported, onlysingle-queue onesdeterministic workloads (useful for testing specialscenarios) not supported in some of them
These shortcomings have led to the development of a CPUscheduling simulator using SDL (sdlCPUSched)
6/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
CPU SchedulingBasics
Related work
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Related work and motivation
Several CPU scheduling simulators have been previouslydeveloped: CPU Scheduling Simulator, CPU SchedulerApplication, Process Scheduling Simulator, MOSSScheduling Simulator . . .
Main shortcomings of these simulators:
algorithms specific for real-time processes are not supportedmultilevel queue algorithms are not supported, onlysingle-queue onesdeterministic workloads (useful for testing specialscenarios) not supported in some of them
These shortcomings have led to the development of a CPUscheduling simulator using SDL (sdlCPUSched)
6/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
CPU SchedulingBasics
Related work
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Related work and motivation
Several CPU scheduling simulators have been previouslydeveloped: CPU Scheduling Simulator, CPU SchedulerApplication, Process Scheduling Simulator, MOSSScheduling Simulator . . .
Main shortcomings of these simulators:
algorithms specific for real-time processes are not supportedmultilevel queue algorithms are not supported, onlysingle-queue onesdeterministic workloads (useful for testing specialscenarios) not supported in some of them
These shortcomings have led to the development of a CPUscheduling simulator using SDL (sdlCPUSched)
7/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
Requirements
BehaviorOverview
Simulatorstructure
DetailedBehavior
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
sdlCPUSched : requirements and assumptions
Main requirements:
simulator for educational purposes, mainly used forbehavior and performance analysis of CPU schedulingalgorithmssupport for non real-time and real-time algorithmssupport for multilevel queue algorithms (number of queues,queue algorithm and queue priority can be configured)
Main assumptions (to simplify the development of thesimulator):
all the processes characteristics are independentonly one CPU burst and zero I/O bursts per process
7/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
Requirements
BehaviorOverview
Simulatorstructure
DetailedBehavior
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
sdlCPUSched : requirements and assumptions
Main requirements:
simulator for educational purposes, mainly used forbehavior and performance analysis of CPU schedulingalgorithmssupport for non real-time and real-time algorithmssupport for multilevel queue algorithms (number of queues,queue algorithm and queue priority can be configured)
Main assumptions (to simplify the development of thesimulator):
all the processes characteristics are independentonly one CPU burst and zero I/O bursts per process
8/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
Requirements
BehaviorOverview
Simulatorstructure
DetailedBehavior
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
sdlCPUSched : behavior overview
Signal-based communication between the simulator and itsenvironment
interactions are mainly asynchronous (only synchronousduring the phase of simulation configuration)
To keep independent intra-queue and inter-queuescheduling functions ⇒ two process types:
MasterSchedulerType for inter-queue scheduling, oneinstanceSlaveSchedulerType for intra-queue scheduling, as manyinstances as ready queues
To minimize the amount of code not automaticallygenerated from the SDL specification:
one simulator program for all the users using the TCPcommunication module included in the SDL tool
programming communication functions with the systemenvironment is avoidedno need to use extra coding in C for sending the portnumber of every instance of the user’s simulator programto its GUI (using files, running program parameters, . . . )one control process required to route signals of one userto the corresponding scheduling processes
10/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
Requirements
BehaviorOverview
Simulatorstructure
DetailedBehavior
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Simulator structure: motivation issues
To keep independent intra-queue and inter-queuescheduling functions ⇒ two process types:
MasterSchedulerType for inter-queue scheduling, oneinstanceSlaveSchedulerType for intra-queue scheduling, as manyinstances as ready queues
To minimize the amount of code not automaticallygenerated from the SDL specification:
one simulator program for all the users using the TCPcommunication module included in the SDL tool
programming communication functions with the systemenvironment is avoidedno need to use extra coding in C for sending the portnumber of every instance of the user’s simulator programto its GUI (using files, running program parameters, . . . )one control process required to route signals of one userto the corresponding scheduling processes
10/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
Requirements
BehaviorOverview
Simulatorstructure
DetailedBehavior
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Simulator structure: motivation issues
To keep independent intra-queue and inter-queuescheduling functions ⇒ two process types:
MasterSchedulerType for inter-queue scheduling, oneinstanceSlaveSchedulerType for intra-queue scheduling, as manyinstances as ready queues
To minimize the amount of code not automaticallygenerated from the SDL specification:
one simulator program for all the users using the TCPcommunication module included in the SDL tool
programming communication functions with the systemenvironment is avoidedno need to use extra coding in C for sending the portnumber of every instance of the user’s simulator programto its GUI (using files, running program parameters, . . . )one control process required to route signals of one userto the corresponding scheduling processes
10/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
Requirements
BehaviorOverview
Simulatorstructure
DetailedBehavior
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Simulator structure: motivation issues
To keep independent intra-queue and inter-queuescheduling functions ⇒ two process types:
MasterSchedulerType for inter-queue scheduling, oneinstanceSlaveSchedulerType for intra-queue scheduling, as manyinstances as ready queues
To minimize the amount of code not automaticallygenerated from the SDL specification:
one simulator program for all the users using the TCPcommunication module included in the SDL tool
programming communication functions with the systemenvironment is avoidedno need to use extra coding in C for sending the portnumber of every instance of the user’s simulator programto its GUI (using files, running program parameters, . . . )one control process required to route signals of one userto the corresponding scheduling processes
11/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
Requirements
BehaviorOverview
Simulatorstructure
DetailedBehavior
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Simulator structure: CPUSchedulerBlockTypeblock type CPUSchedulerBlockType 1(1)
creating a masterScheduler process for a simulationrequested by one userdispatching signals coming from different users to thecorresponding masterScheduler process
masterSchedulerType:simulation configurationinter-queues algorithm (the maximum priority non-emptyready queue is activated)access control of the ready queues shared variables
slaveSchedulerType:simulation of a simple (one ready queue) schedulingalgorithm
finding process arrivals (storing every arrived process inthe ready queue)selecting a process from the ready queue to be executed(leaves the ready queue)interrupting a process and returning it to the ready queueterminating a process when its CPU burst is completed(storing the process in the finished queue)
12/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
Requirements
BehaviorOverview
Simulatorstructure
DetailedBehavior
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Process Type functionscontrolType process type:
creating a masterScheduler process for a simulationrequested by one userdispatching signals coming from different users to thecorresponding masterScheduler process
masterSchedulerType:simulation configurationinter-queues algorithm (the maximum priority non-emptyready queue is activated)access control of the ready queues shared variables
slaveSchedulerType:simulation of a simple (one ready queue) schedulingalgorithm
finding process arrivals (storing every arrived process inthe ready queue)selecting a process from the ready queue to be executed(leaves the ready queue)interrupting a process and returning it to the ready queueterminating a process when its CPU burst is completed(storing the process in the finished queue)
12/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
Requirements
BehaviorOverview
Simulatorstructure
DetailedBehavior
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Process Type functionscontrolType process type:
creating a masterScheduler process for a simulationrequested by one userdispatching signals coming from different users to thecorresponding masterScheduler process
masterSchedulerType:simulation configurationinter-queues algorithm (the maximum priority non-emptyready queue is activated)access control of the ready queues shared variables
slaveSchedulerType:simulation of a simple (one ready queue) schedulingalgorithm
finding process arrivals (storing every arrived process inthe ready queue)selecting a process from the ready queue to be executed(leaves the ready queue)interrupting a process and returning it to the ready queueterminating a process when its CPU burst is completed(storing the process in the finished queue)
13/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
Requirements
BehaviorOverview
Simulatorstructure
DetailedBehavior
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Procedures relating to single-queue algorithms
Two types of behavior in single queue schedulingalgorithms:
behavior common to all the algorithms: included in thegenericAlgorithm procedurealgorithm-dependent behavior: included in algorithmspecific procedures (one per single-queue algorithm)
Low level tasks (for example, managing process queues andupdating the clock) are specified in auxiliary procedures(findArrivals, executeProcess, interruptProcess, etc.)
main behavior of the algorithm is clearly specified withoutunnecessary low-level details
13/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
Requirements
BehaviorOverview
Simulatorstructure
DetailedBehavior
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Procedures relating to single-queue algorithms
Two types of behavior in single queue schedulingalgorithms:
behavior common to all the algorithms: included in thegenericAlgorithm procedurealgorithm-dependent behavior: included in algorithmspecific procedures (one per single-queue algorithm)
Low level tasks (for example, managing process queues andupdating the clock) are specified in auxiliary procedures(findArrivals, executeProcess, interruptProcess, etc.)
main behavior of the algorithm is clearly specified withoutunnecessary low-level details
AND (NOT(nextArrivalT = NOMOREPROCESSES)) terminateProcess(verboseMode,
aborting, runningProcess, processInExec,
clock, language, clientData) to PARENT
call emptyList(readyList)
checkingArrivals
decrRemainingExecT(runningProcess,
nextArrivalT−clock) to PARENT
False
True
False
False
True
True
17/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
The CPU Scheduler Simulator Graphical UserInterface: tkCPUSched
A graphical user interface (GUI) has been developed tosimplify the access to the simulator functionalities
simulator program generated from the SDL specification isonly accessible through a TCP socket
GUI developed using Tcl/Tk languageinterpreted language that provides rapid development ofcross-platform graphical user interfaces
GUI module for parsing simulator outgoing signals:format of the signals interchanged with the environment:Telelogic ASCII encoding (TCP communications module)
example: {1}{’schedulerEnd c’}{{’127.0.0.1’,50205}}parsing module based on an automatically generated parserand lexical analyzer
parser and lexical analyzer based on a grammar specific tothe ASCII encoding: changes in the signal encoding ⇒modifying the grammar and re-generating the parser andlexical analyzerGUI can be adapted to support a simulator generated bydifferent SDL case tools
17/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
The CPU Scheduler Simulator Graphical UserInterface: tkCPUSched
A graphical user interface (GUI) has been developed tosimplify the access to the simulator functionalities
simulator program generated from the SDL specification isonly accessible through a TCP socket
GUI developed using Tcl/Tk languageinterpreted language that provides rapid development ofcross-platform graphical user interfaces
GUI module for parsing simulator outgoing signals:format of the signals interchanged with the environment:Telelogic ASCII encoding (TCP communications module)
example: {1}{’schedulerEnd c’}{{’127.0.0.1’,50205}}parsing module based on an automatically generated parserand lexical analyzer
parser and lexical analyzer based on a grammar specific tothe ASCII encoding: changes in the signal encoding ⇒modifying the grammar and re-generating the parser andlexical analyzerGUI can be adapted to support a simulator generated bydifferent SDL case tools
17/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
The CPU Scheduler Simulator Graphical UserInterface: tkCPUSched
A graphical user interface (GUI) has been developed tosimplify the access to the simulator functionalities
simulator program generated from the SDL specification isonly accessible through a TCP socket
GUI developed using Tcl/Tk languageinterpreted language that provides rapid development ofcross-platform graphical user interfaces
GUI module for parsing simulator outgoing signals:format of the signals interchanged with the environment:Telelogic ASCII encoding (TCP communications module)
example: {1}{’schedulerEnd c’}{{’127.0.0.1’,50205}}parsing module based on an automatically generated parserand lexical analyzer
parser and lexical analyzer based on a grammar specific tothe ASCII encoding: changes in the signal encoding ⇒modifying the grammar and re-generating the parser andlexical analyzerGUI can be adapted to support a simulator generated bydifferent SDL case tools
17/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
The CPU Scheduler Simulator Graphical UserInterface: tkCPUSched
A graphical user interface (GUI) has been developed tosimplify the access to the simulator functionalities
simulator program generated from the SDL specification isonly accessible through a TCP socket
GUI developed using Tcl/Tk languageinterpreted language that provides rapid development ofcross-platform graphical user interfaces
GUI module for parsing simulator outgoing signals:format of the signals interchanged with the environment:Telelogic ASCII encoding (TCP communications module)
example: {1}{’schedulerEnd c’}{{’127.0.0.1’,50205}}parsing module based on an automatically generated parserand lexical analyzer
parser and lexical analyzer based on a grammar specific tothe ASCII encoding: changes in the signal encoding ⇒modifying the grammar and re-generating the parser andlexical analyzerGUI can be adapted to support a simulator generated bydifferent SDL case tools
18/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
tkCPUSched : main window
Additional features:queue status shown during simulation (and process statisticvalues)plotting of Gantt charts during simulation
18/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
tkCPUSched : main window
Additional features:queue status shown during simulation (and process statisticvalues)plotting of Gantt charts during simulation
19/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Conclusions (I)
Simulator features:simulator capable of simulating the behavior of
one-queue scheduling algorithms (appropriate for one classof processes workloads)multilevel queue algorithms (appropriate for workloadsconsisting of processes with different schedulingrequirements)
simulation results (per-process and global statistics) andsimulation events shown in a human-readable format usinga graphical user interface
results and events can also be saved in files
graphical user interface developed with the Tcl/Tklanguage: rapid development and cross-platform supportparsing of signals outgoing simulator program based on agrammar definition of their encoding method
change of the encoding method only implies minimumchanges in the graphical user interface (adapting thegrammar and re-generating the parser and lexical analyzer)GUI customizable to interact with simulators generated bydifferent SDL case tools
19/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Conclusions (I)
Simulator features:simulator capable of simulating the behavior of
one-queue scheduling algorithms (appropriate for one classof processes workloads)multilevel queue algorithms (appropriate for workloadsconsisting of processes with different schedulingrequirements)
simulation results (per-process and global statistics) andsimulation events shown in a human-readable format usinga graphical user interface
results and events can also be saved in files
graphical user interface developed with the Tcl/Tklanguage: rapid development and cross-platform supportparsing of signals outgoing simulator program based on agrammar definition of their encoding method
change of the encoding method only implies minimumchanges in the graphical user interface (adapting thegrammar and re-generating the parser and lexical analyzer)GUI customizable to interact with simulators generated bydifferent SDL case tools
19/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Conclusions (I)
Simulator features:simulator capable of simulating the behavior of
one-queue scheduling algorithms (appropriate for one classof processes workloads)multilevel queue algorithms (appropriate for workloadsconsisting of processes with different schedulingrequirements)
simulation results (per-process and global statistics) andsimulation events shown in a human-readable format usinga graphical user interface
results and events can also be saved in files
graphical user interface developed with the Tcl/Tklanguage: rapid development and cross-platform supportparsing of signals outgoing simulator program based on agrammar definition of their encoding method
change of the encoding method only implies minimumchanges in the graphical user interface (adapting thegrammar and re-generating the parser and lexical analyzer)GUI customizable to interact with simulators generated bydifferent SDL case tools
19/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Conclusions (I)
Simulator features:simulator capable of simulating the behavior of
one-queue scheduling algorithms (appropriate for one classof processes workloads)multilevel queue algorithms (appropriate for workloadsconsisting of processes with different schedulingrequirements)
simulation results (per-process and global statistics) andsimulation events shown in a human-readable format usinga graphical user interface
results and events can also be saved in files
graphical user interface developed with the Tcl/Tklanguage: rapid development and cross-platform supportparsing of signals outgoing simulator program based on agrammar definition of their encoding method
change of the encoding method only implies minimumchanges in the graphical user interface (adapting thegrammar and re-generating the parser and lexical analyzer)GUI customizable to interact with simulators generated bydifferent SDL case tools
20/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Conclusions (II)
Experiences in the simulator development with SDL:behavior specification of a scheduling algorithm is easier inSDL than in a programming language
a flow chart describing high-level algorithm behavior canbe used to obtain SDL specificationsSDL graphical syntax is more expressive than code for thedescription of an algorithm behavior
development and testing of concurrent applications easierin SDL
signal or procedure based communication in SDL versusexternal communications libraries, ad-hoc methods orshared variables in a programming languagecommunications between processes explicitly shown(messages that can be exchanged, the sources anddestinations allowed . . . )powerful testing tools, including tracing of messagesexchanged among processes (for example, MSC trace)
20/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Conclusions (II)
Experiences in the simulator development with SDL:behavior specification of a scheduling algorithm is easier inSDL than in a programming language
a flow chart describing high-level algorithm behavior canbe used to obtain SDL specificationsSDL graphical syntax is more expressive than code for thedescription of an algorithm behavior
development and testing of concurrent applications easierin SDL
signal or procedure based communication in SDL versusexternal communications libraries, ad-hoc methods orshared variables in a programming languagecommunications between processes explicitly shown(messages that can be exchanged, the sources anddestinations allowed . . . )powerful testing tools, including tracing of messagesexchanged among processes (for example, MSC trace)
21/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Further work
Improvements for the current version of the simulator:
adding more complex algorithms, like multilevel feedbackqueue schedulingmulti-processor / multi-core algorithmssupport of processes with several CPU and I/O bursts
21/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Further work
Improvements for the current version of the simulator:
adding more complex algorithms, like multilevel feedbackqueue schedulingmulti-processor / multi-core algorithmssupport of processes with several CPU and I/O bursts
21/22
Design andDevelopment
of a CPUScheduler
Simulator forEducational
PurposesUsing SDL
ManuelRodrıguez-Cayetano
Summary
CPUSchedulingOverview
The SDL CPUSchedulerSimulator
The CPUSchedulerSimulatorGraphicalUser Interface
Conclusionsand FurtherWork
Further work
Improvements for the current version of the simulator:
adding more complex algorithms, like multilevel feedbackqueue schedulingmulti-processor / multi-core algorithmssupport of processes with several CPU and I/O bursts