ITEC 95(SIR ROWEE) Flashcards
Advantages of Modeling & Simulation
Allows for testing hypothetical scenarios without actual implementation.
- Can minimize risks and optimize performance.
- Provides a cost-effective solution for solving complex problems.
Limitations of Modeling & Simulation
Models may not accurately capture real-world behavior.
- Can be time-consuming and require expertise to create.
- Data availability and quality can greatly affect the accuracy of the simulation.
: One of the significant advantages of modeling and simulation is that it allows for extensive testing without the need for a physical prototype.
Testing
Modeling and simulation can also make upgrading an existing system or process more efficient.
Upgrading:
Another benefit of modeling and simulation is the ability to identify constraints in a system.
Identifying constraints:
Modeling and simulation can also be useful for diagnosing problems in a system.
Diagnostics:
Modeling and simulation can handle complex systems and processes that would be difficult to analyze using traditional methods.
Complexity:
One potential disadvantage of modeling and simulation is that it may not accurately represent the real-world system. This can result in false positives or false negatives during testing.
Testing:
Another disadvantage is that the simulation may not accurately predict the impact of changes on the system. This can result in unexpected consequences when the changes are made in the physical system.
Upgrading
Modeling and simulation may also fail to identify constraints that are not included in the model.
Identifying constraints
Similarly, modeling and simulation may miss problems that are not included in the model.
Diagnostics:
Modeling and simulation can also be time-consuming and require significant computational resources, particularly for complex systems.
Complexity
Modeling and simulation can have ethical implications, such as the use of virtual animal testing instead of real-life testing.
Ethical Considerations
Transparency and accountability are important in the use and development of simulations.
Ethical Considerations
Advancements in technology such as artificial intelligence and machine learning can improve the accuracy and efficiency of simulation.
Future of Modeling & Simulation
More widespread use in fields such as urban planning and climate change modeling.
Future of Modeling & Simulation
Here are some examples of ethical considerations in modeling and simulation:
Data privacy
Bias and discrimination
Safety and reliability
Intellectual property
Transparency and accountability
The use of modeling and simulation is increasing in many fields, and there is a growing demand for professionals with expertise in this area.
Career Opportunities
Deciding which process/thread should occupy the resource (CPU, disk, etc)
Process Scheduling
Switch CPU from one process to another
Performed by scheduler
Context Switch
Need hardware support
Context Switch
When should the scheduler be called?
A new process is admitted
The running process exits
The running process is blocked
I/O interrupt (some processes will be ready)
Clock interrupt (every 10 milliseconds)
The running process keeps the CPU until it voluntarily gives up the CPU
process exits
switches to blocked state
Transition 3 is only voluntar
Non-preemptive scheduling:
The running process can be interrupted and must release the CPU (can be forced to give up CPU)
Preemptive scheduling
(equitable shares of CPU)
Fairness
highest priority first)
Priority
make best use of equipment)
Efficiency
(can’t take advantage of the system)
Encouraging good behavior
degrade gracefully
Support for heavy loads
interactive, real-time, multi-media
Adapting to different environments
: keep resources as busy as possible
Efficiency
of processes that complete in unit time
Throughput:
Total amount of time spent by the process waiting in ready queue
Waiting Time
Amount of time spent by the process waiting in ready queue before it starts executing
Initial Waiting Time
amount of time from when a job is admitted until it completes
Response Time
Assign CPU proportionally to given application weight
Proportionality:
Proportionality:
Meeting Deadlines
Scheduling should load balance between I/O bound and CPU-bound processes
Ideal would be to run all equipment at 100% utilization but that would not necessarily be good for response time
Process Mix
Process that requests the CPU FIRST is allocated the CPU FIRST.
Also called _____
Used in Batch Systems
Implementation
First Come First Serve (FCFS)
Is it Preemptive or Non-preemptive?
NON-PREEMPTIVE
Problems with FCFS
Non-preemptive
Does not minimize AWT
Cannot utilize resources in parallel
Usually preemptive
Time is sliced into quanta (time intervals)
Scheduling decision is also made at the beginning of each quantum
Performance Criteria
Average response time
Average initial waiting time
Average waiting time
Fairness (or proportional resource allocation)
Representative algorithms:
Round-robin
Priority-based
Interactive Scheduling Algorithms
One of the oldest, simplest, most commonly used scheduling algorithm
Select process/thread from ready queue in a round-robin fashion (take turns)
Round-robin
Schedule the job with the shortest computation time first
Scheduling in Batch Systems
Two types:
Non-preemptive
Preemptive
Optimal if all jobs are available simultaneously: Gives the best possible AWT (average waiting time)
Shortest Job First (SJF)
Shortest job runs first.
A job that arrives and is shorter than the running job will preempt it
Preemptive SJF
A job may keep getting preempted by shorter ones
Starvation
A Problem with Preemptive SJF
STARVATION
Examples include Air Combat Training Simulation
System, Tactical Air Crew Combat Training System,
ZAP Missile Launch, Integrated Air Defense
Systems.
- Used to train soldiers in a simulated environment
that replicates real-life scenarios.
- Helps improve decision-making skills and
situational awareness of soldiers
Simulation for Training
- Examples include Full Body Vasculature Silicone
Model, Vital Sign Simulation, CFD Simulation. - Used to train medical professionals and students
in a safe and controlled environment. - Helps improve skills and knowledge in diagnosis,
treatment, and surgery.
Simulation for Health and
Medicine
- Examples include Multi-physics simulation in ski
manufacturing, simulation for fuel injector design
and spray. - Used to design and improve engineering systems
and products. - Helps predict system behavior, optimize product
performance, and reduce costs and production
time
Simulation for Engineering
- Simulations in education are somewhat like
training simulations. They focus on specific
tasks. - a more recent use of simulation in education
include animated narrative vignettes (ANV). ANVs
are cartoon-like video narratives of hypothetical
and reality-based stories involving classroom
teaching and learning
Simulation in Education
Discuss how modeling and simulation
are used in the telecommunications
industry to design and optimize
networks, predict and prevent failures,
and improve performance.
Simulation in
Telecommunications:
Discuss how modeling and simulation
are used in business to make decisions,
forecast trends, and optimize
processes
Simulation in Business:
Discuss how modeling and
simulation are used in training and
support for various industries,
such as healthcare and aviation
Simulation in Training and
Support:
Provides a safe and controlled environment for
training and experimentation.
- Helps improve decision-making skills, knowledge,
and performance in various fields.
- Reduces costs and production time by optimizing
product design and performance
Benefits of Modeling and
Simulation
- Allows for testing hypothetical scenarios without actual implementation.
- Can minimize risks and optimize performance.
- Provides a cost-effective solution for solving complex problems
Advantages of Modeling &
Simulation
- Models may not accurately capture real-world
behavior. - Can be time-consuming and require expertise to
create. - Data availability and quality can greatly affect the
accuracy of the simulation.
Limitations of Modeling &
Simulation
TT=
CT-AT
WT=
TT-BT
CT=
AT+BT
CPU UTILIZATION=
(TOTAL CT/TOTAL ELAPSED TIME)*100%
Usually preemptive
Time is sliced into quanta (time intervals)
Scheduling decision is also made at the beginning of each quantum
Performance Criteria
Average response time
Average initial waiting time
Average waiting time
Fairness (or proportional resource allocation)
Representative algorithms:
Round-robin
Priority-based
Interactive Scheduling
Algorithms
One of the oldest, simplest, most commonly used
scheduling algorithm
Select process/thread from ready queue in a
round-robin fashion (take turns)
Round-robin
70-80% of jobs block within time-slice
Heuristic:
10-100 ms (depends on job priority)
Typical time-slice
Too many context switches (overheads)
Inefficient CPU utilization
Time slice too small
FIFO behavior
Poor initial waiting time
Time slice too large
Schedule the job with the shortest
computation time first
Scheduling in Batch Systems
Shortest Job First (SJF)
TWO TYPES OF SJF:
Non-preemptive
Preemptive
Shortest job runs first.
A job that arrives and is shorter than the
running job will preempt it
Preemptive SJF
A Problem with Preemptive
SJF
Starvation
A job may keep getting preempted by shorter ones
Starvation
time it takes for the dispatcher
to stop one process and start another running
Dispatch latency
Selects from among the processes in memory that are
ready to execute, and allocates the CPU to one of them
CPU Scheduler
gives control of the CPU to the
process selected by the scheduler; this involves:
Dispatcher module
keep the CPU as busy as
possible
CPU utilization
of processes that complete their
execution per time unit
Throughput
amount of time to execute a
particular process
Turnaround time
amount of time a process has
been waiting in the ready queue
Waiting time
amount of time it takes from
when a request was submitted until the first
response is produced, not output (for
time-sharing environment)
Response time
Associate with each process the length of its next
CPU burst. Use these lengths to schedule the
process with the shortest time.
Shortest-Job-First (SJF) Scheduling
gives minimum average waiting
time for a given set of processes
SJF is optimal
A priority number (integer) is associated with each process
Priority Scheduling
The CPU is allocated to the process with the highest
priority (smallest integer ≡ highest priority)
Priority Scheduling
low priority processes may never
execute
Starvation
as time progresses increase the priority
of the process
Aging
Each process gets a small unit of CPU time (time
quantum), usually 10-100 milliseconds. After this time
has elapsed, the process is preempted and added to the end
of the ready queue.
Round Robin (RR)
Ready queue is partitioned into separate queues:
foreground (interactive)
background (batch)
Each queue has its own scheduling algorithm:
foreground – RR
background – FCFS
Scheduling must be done between the queues:
Fixed priority scheduling; (i.e., serve all from foreground then
from background). Possibility of starvation.
Time slice – each queue gets a certain amount of CPU time which
it can schedule amongst its processes; i.e., 80% to foreground in
RR
20% to background in FCFS
Multilevel Queue
A process can move between the various queues; aging can be
implemented this way.
Multilevel-feedback-queue scheduler defined by the following
parameters:
Multilevel Feedback Queue
Distinction between user-level and kernel-level threads
Many-to-one and many-to-many models, thread library schedules user-level
threads to run on LWP
Known as process-contention scope (PCS) since scheduling
competition is within the process
Thread Scheduling
Kernel thread scheduled onto available CPU is system-contention scope
(SCS) – competition among all threads in system
Thread Scheduling
competition among all threads in system
system-contention scope
(SCS)
API allows specifying either PCS or SCS during thread creation
Pthread Scheduling
CPU scheduling more complex when multiple CPUs are available
Multiple-Processor Scheduling
only one processor accesses the system data
structures, alleviating the need for data sharing
Asymmetric multiprocessing
each processor is self-scheduling, all
processes in common ready queue, or each has its own private queue of
ready processes
Symmetric multiprocessing (SMP)
process has affinity for processor on which it is
currently running
Processor affinity
Recent trend to place multiple processor cores on same physical chip
Multicore Processors
Faster and consume less power
Multicore Processors
Multiple threads per core also growing
Takes advantage of memory stall to make progress on another thread
while memory retrieve happens
Multicore Processors
Constant order O(1) scheduling time
Linux Scheduling
Two priority ranges: time-sharing and real-time
Linux Scheduling
Real-time range from 0 to 99 and nice value from 100 to 140
Linux Scheduling
takes a particular predetermined workload and
defines the performance of each algorithm for that workload
Deterministic modeling