Transcript Review #3
Quiz 4 Review
Chapters 10, 11, 12, 14
1
Roles of an Operating System
Operating system
System software that
– manages computer resources, such as
memory and input/output devices
– provides an interface through which a human
can interact with the computer
– allows an application program to interact with
these other system resources
2
Roles of an Operating System
What operating
systems have
you used?
Figure 10.1
An operating system
interacts with many
aspects of a computer
system.
3
Roles of an Operating System
The various roles of an operating system
generally revolve around the idea of
“sharing nicely”
An operating system manages resources,
and these resources are often shared in one
way or another among programs that want
to use them
4
Resource Management
Multiprogramming
The technique of keeping multiple programs that
compete for access to the CPU in main memory at
the same time so that they can execute
Memory management
The process of keeping track of what programs are
in memory and where in memory they reside
5
Resource Management
Process
A program in execution
Process management
The act of carefully tracking the progress of a
process and all of its intermediate states
CPU scheduling
Determining which process in memory is executed
by the CPU at any given point
6
Timesharing
Timesharing system
A system that allows multiple users to interact with
a computer at the same time
Virtual machine
The illusion created by a time-sharing system that
each user has his/her own machine
As computer speed increased, the human
operator became the bottleneck
7
Other Factors
Real-time System
A system in which response time is crucial given
the nature of the application
Response time
The time delay between receiving a stimulus and
producing a response
Device driver
A small program that “knows” the way a particular
device expects to receive and deliver information
8
Paged Memory Management
Demand paging
An extension of paged memory management in
which pages are brought into memory on demand
Page swap
The act of bringing in a page from secondary
memory, which often causes another page to be
written back to secondary memory
9
Paged Memory Management
Virtual memory
The illusion that there are no restrictions on the
size of a program because an entire process
doesn't have to be in memory at the same time
Thrashing
Inefficient processing caused by constant page
swaps
Relate the expression "all computing is a
tradeoff" to this process
10
Process Management
Process management
The act of managing the use of the CPU by
individual processes
Recall that a process is a program in
execution
What stages does a process go through?
11
Process Management
The Process States
What can
cause a
process to
move to
the
Waiting
state?
Figure 10.8 The process life cycle
12
Process Management
Process control block (PCB)
A data structure used by the OS to manage
information about a process, including
–
–
–
–
current value of the program counter
values of all CPU registers for the process
base and bound register values (or page tables)
accounting information
Each state is represented by a list of PCBs, one
for each process in that state
13
Process Management
There is only one CPU and therefore only one set of CPU
registers, which contain the values for the currently
executing process
Each time a process is moved to the running state:
– Register values for the currently running process
are stored into its PCB
– Its PCB is moved to the list of the state into which it goes
– Register values of the new process moving into the running
state are loaded into the CPU
– This exchange of register information is called a context
switch
14
CPU Scheduling
CPU Scheduling
The act of determining which process in the ready
state should be moved to the running state
– Many processes may be in the ready state
– Only one process can be in the running state, making
progress at any one time
Which one gets to move from ready to running?
15
CPU Scheduling
Nonpreemptive scheduling
The currently executing process gives up the CPU
voluntarily
Preemptive scheduling
The operating system decides to favor another process,
preempting the currently executing process
Turnaround time
The amount of time between when a process arrives in the
ready state the first time and when it exits the running state
for the last time
16
CPU Scheduling Algorithms
First-Come, First-Served
Processes are moved to the CPU in the order in which they
arrive in the running state
Shortest Job Next
Process with shortest estimated running time in the ready
state is moved into the running state first
Round Robin
Each process runs for a specified time slice and moves
from the running state to the ready state to await its next
turn if not finished
17
Chapter 11
FILE SYSTEMS
18
File Systems
File
A named collection of related data, used for
organizing secondary memory
File system
The operating system's logical view of the files it
manages
Directory
A named group of files
19
File Access
Sequential access
The technique in which data in a file is accessed in
a linear fashion; to get the last record, you must
read all of the records
Direct access
The technique in which data in a file is
conceptually divided into numbered logical records
and accessed directly, by specifying logical record
numbers
20
File Protection
An example of a file protection scheme is the file
settings in the Unix operating system, which are
divided into three categories
21
Directory Trees
Parent directory
The containing directory
Subdirectory
The directory being contained
Directory tree
A logical view of a file system; a structure showing the
nested directory organization of a file system
Root directory
The directory at the highest level
22
Disk Scheduling
As a computer deals with multiple processes over
a period of time, a list of requests to access the
disk builds up
Disk scheduling
The technique that the operating system uses to
determine which requests to satisfy first
23
Disk Scheduling
First-Come, First-Served (FCFS)
Sound familiar?
Requests are serviced in the order they arrive,
without regard to the current position of the heads
Shortest-seek-time-first (SSTF)
Disk heads are moved the minimum amount
possible to satisfy a pending request
Scan
Disk heads continuously move in and out servicing
requests as they are encountered
24
Chapter 12
MANAGEMENT INFORMATION
SYSTEMS
25
Managing Information
Information system
Software that helps the user organize and analyze
data
Electronic spreadsheets and database
management systems
Software tools that allow the user to organize,
manage, and analyze data in various ways
Have you ever used a spreadsheet?
26
Database Management Systems
Database
A structured set of data
Database management system (DBMS)
A combination of software and data, made up of a
physical database, a database engine, and a
database schema
Physical database
A collection of files that contain the data
27
Database Management Systems
Database engine
Software that supports access to and modification of the
database contents
Database schema
A specification of the logical structure of the data stored in
the database
Database query
A request to retrieve data from a database
28
The Relational Model
Relational DBMS
A DBMS in which the data items and the relationships among
them are organized into tables
Tables
A collection of records
Records (object, entity)
A collection of related fields that make up a single database
entry
Fields (attributes)
A single value in a database record
29
A Database Table
Key
One or more fields of a database record that
uniquely identifies it among all other records in the
table
We can express the schema for this part of the
database as follows:
Movie (MovieId:key, Title, Genre, Rating)
30
Structured Query Language
Structured Query Language (SQL)
A comprehensive relational database language for
data manipulation and queries
select attribute-list from table-list where condition
name of field
select Title from
name of table
Movie
value restriction
where Rating = 'PG'
Result is a table containing all PG movies in table Movie
31
Database Design
Entity-relationship (ER) modeling
A popular technique for designing relational
databases
ER Diagram
A graphical representation of an ER model
Cardinality constraint
The number of relationships that may exist at one
time among entities in an ER diagram
32
E-Commerce
Electronic commerce
The process of buying and selling products
and services using the Web.
Can you name at least 4 e-commerce sites
that you have visited lately?
What made e-commerce feasible and easy?
What problems does e-commerce face?
33
Chapter 14
SIMULATION
34
What Is Simulation?
•Simulation
•A model of a complex system and the experimental
manipulation of the model to observe the results
Systems that are best suited to being simulated are
dynamic, interactive, and complicated
•Model
•An abstraction of a real system
It is a representation of the objects within the system
and the rules that govern the interactions of the objects
35
Reasons for Simulation
• Forecasting or predicting the future
– Weather forecast
– Stock market
• Accessing the inaccessible or impossible
– Reactor meltdown
– Crush depth of a submarine
• Experimentation and testing
– “What if” section of a PC income tax program
– Fighter jet flight simulator
• Education and training
• Cost savings
Reasons for Simulation
• Education and training
– Commercial flight simulator
– Virtual surgery
• Cost savings
– Military weapons training
– Automotive design
– Airplane design
• Simulation is used to mimic or imitate some phenomenon in a way
that represents the real situation
• Model is the mathematical / computational representation of the
phenomenon
Constructing Models
• Continuous simulation
– Treats time as continuous
– Expresses changes in terms of a set of
differential equations that reflect the
relationships among the set of characteristics
– Meteorological models fall into this category
38
Constructing Models
•Discrete event simulation
•Made up of entities, attributes, and events
– Entity The representation of some object in
the real system that must be explicitly defined
– Attribute Some characteristic of a particular
entity
– Event An interaction between entities
39
Building a Model
• All models have characteristics
– Continuous systems have quantities that vary
smoothly or in a continuous manner
– Discrete systems have quantities that vary in steps
or jumps
– Predictable systems have models that produce
repeatable results (given the same inputs)
– Unpredictable systems have models that contain
unpredictable features (random number)
– Feedback loops are used by models that feed
results back as part of the next input
Queuing Systems
•Queuing system
•A discrete-event model that uses random
numbers to represent the arrival and
duration of events
•The system is made up of
– servers
– queues of objects to be served
41
Please
wait!
Meteorological Models
•Meteorological models
•Models based on the time-dependent
partial differential equations of fluid
mechanics and thermodynamics
•Initial values for the variables are entered
from observation, and the equations are
solved to define the values of the variables
at some later time
42
Meteorological Models
• Relocatable models
• Models applied to a moving target
•
Can you think of an example?
•
What is special about weather models?
43
Hurricane Tracking
(GFDL)
Geophysical
and Fluid
Dynamics
Laboratory
44
Monopoly Game Simulation
• Monopoly consists of a system of rules and a
simple objective
• Basic flow of the game can be implemented via
software
• Accuracy and complexity of the model used by
the game directly affects the realism of the
simulation
• Example: get out of jail
– Roll doubles (3 attempts and then pay $)
– Pay $50
– Use get out of jail free card
Monopoly Game Simulation
• Look at the probability of the game
• “Jail” has the highest probability of all properties
on the board
• Examine properties that are “1 roll of the dice”
away
• Look at the return on investment graph
– Based on probability of people landing on property
– Computes ROI of adding houses / hotels
Graphics
Illumination model
Simulation of light interaction at one point
on an object
Shading model (shading)
Process of using an illumination model
to determine the appearance of an
entire object
Rendering
The process of creating an entire image
47