COP4610 EXAM 1 STUDY GUIDE
Operating system - Answer -- Acts as an intermediary between the user and the
computer hardware.
- Software that manages the computer hardware.
- Purpose is to provide an environment in which a user can execute programs in a
convenient and efficient manner.
- A virtual machine that hides the complexity and limitation of hardware from application
programmers
History Phase I: Expensive Hardware, Cheap Humans - Answer -Hardware:
mainframes
OS: human operators
- Handle one job (a unit of processing at a time.
- Computer time wasted while operators walk around the machine room.
Batch system - Answer -Collects a batch of jobs before processing them and printing
out results.
- collection, processing, and printing out results can occur concurrently.
Job - Answer -A unit of programming
Batch System - Answer -Collects a batch of jobs before processing them and printing
out results
Timeshares - Answer -Each user can afford to user terminals to interact with machines
OS Design goals: - Answer -Efficient use of the hardware
More efficient use of human resources
Allow a user to perform many tasks at one time
Ease of resource sharing between machines
Four phases of OS history - Answer -Hardware expensive, humans cheap
Hardware cheap, humans expensive
Hardware very cheap, humans very expensive
Distributed systems
Multiprocessing - Answer -The ability to use multiple processors on the same machine
,Multitasking - Answer -Ability to run multiple programs on the same machine
Multiprogramming - Answer -Multiple programs can run concurrently
Benefits of concurrency - Answer -Can run multiple programs simultaneously
Better resource utilization
Better average response time
Better performance
Thread - Answer -A sequential execution stream
Address space - Answer -Contains all necessary states to run a program
Process - Answer -An address space and at least one thread of execution
Difference between process and program - Answer -A program is just a collection of
statements, a process is a running instance of a program.
Uniprogramming - Answer -Running one process at a time
Multithreading - Answer -having multiple threads per address space
Dispatching loop - Answer -Run thread
Save States
Choose new thread
Load states from new thread
Context switch - Answer -Switching the CPU from one thread/process to another
Thread state diagram - Answer -Ready -> Running -> Blocked ->Ready etc.
Ready-> Running: Scheduled
Running-> Ready: yield, timer
Running -> Blocked: I/O request
Blocked -> Ready: IO complete
Amdahl's Law - Answer -S = %of sequential computations
N = cores
x = 1/(S + (1-S/N))
Booting sequence - Answer -Jump
Load from BIOS
,POST
Load MBR
Load OS loader
Load kernel image
sets kernel mode
Jump
System call - Answer -Allows processes running in user mode to access kernel
functions that run under kernel mode
Kernel Mode - Answer -Used for lowest level functions of operating system. Executing
code has unrestricted access to hardware
User mode - Answer -Executing code has no way to directly access or modify hardware
or reference memory
Master Boot Record - Answer -Information in the first sector of memory that identifies
how and where to boot the OS
System call sequence - Answer -User level: Trap
Kernel Level: Set kernel mode
Branch table
Run trusted code
Process creation - Answer -fork(): Clones the process
exec: overwrites current process
to run one different from parent
pthread_create(): a newly created thread will share the address space AND resources
of current process
Starvation - Answer -Program is denied the resources it needs to work
Preemptive Scheduling - Answer -A job can be forcibly suspended by a CPU interrupt
and the CPU can work on something else.
Non Preemptive Scheduling - Answer -Once started, a job cannot be taken off the CPU
and will run to completion
First in First Out - Answer -First in first out scheduling, works best when all jobs are
short, works bad when jobs are varying sizes.
Not preemptive
, Round Robin - Answer -Jobs take predetermined length turns on the CPU. Shorter
response time, fair sharing of cpu
not all jobs preemptive, not good for jobs of the same length
Preemptive
Shortest Job first - Answer -Non preemptive
Runs whichever job is shortest first. Runs best when jobs are usually short, degradation
for longer jobs. Turns into FIFO if jobs are the same length.
Shortest time remaining first - Answer -Preemptive version of shortest job first. Short
jobs do not get stuck behind anything under SRTF
Multilevel Feedback Queue - Answer -Uses multiple queues with different priorities
Round robin: Run highest priority jobs first.
Jobs start in highest priority. If time expires they go down, if time does not expire they
go up.
Approximates SRTF, CPU jobs lose priority, I/O jobs stay near the top.
Counter measure: Aging
Lottery Scheduling - Answer -Adaptive approach to address fairness. Every process is
given a number of tickets based on its size, shorter jobs get more. Every time slice a
random "ticket" is chosen. Each job gets at least one ticket
Atomic operation - Answer -An atomic operation runs to completion, it is all or nothing
Race conditions - Answer -occur when threads share data and their results depend on
the timing of their executions
Independent Threads - Answer -No states shared with other threads
Deterministic computation
Reproducible
Cooperating threads - Answer -Shared states
Non deterministic
Non reproducible
Why?
Operating system - Answer -- Acts as an intermediary between the user and the
computer hardware.
- Software that manages the computer hardware.
- Purpose is to provide an environment in which a user can execute programs in a
convenient and efficient manner.
- A virtual machine that hides the complexity and limitation of hardware from application
programmers
History Phase I: Expensive Hardware, Cheap Humans - Answer -Hardware:
mainframes
OS: human operators
- Handle one job (a unit of processing at a time.
- Computer time wasted while operators walk around the machine room.
Batch system - Answer -Collects a batch of jobs before processing them and printing
out results.
- collection, processing, and printing out results can occur concurrently.
Job - Answer -A unit of programming
Batch System - Answer -Collects a batch of jobs before processing them and printing
out results
Timeshares - Answer -Each user can afford to user terminals to interact with machines
OS Design goals: - Answer -Efficient use of the hardware
More efficient use of human resources
Allow a user to perform many tasks at one time
Ease of resource sharing between machines
Four phases of OS history - Answer -Hardware expensive, humans cheap
Hardware cheap, humans expensive
Hardware very cheap, humans very expensive
Distributed systems
Multiprocessing - Answer -The ability to use multiple processors on the same machine
,Multitasking - Answer -Ability to run multiple programs on the same machine
Multiprogramming - Answer -Multiple programs can run concurrently
Benefits of concurrency - Answer -Can run multiple programs simultaneously
Better resource utilization
Better average response time
Better performance
Thread - Answer -A sequential execution stream
Address space - Answer -Contains all necessary states to run a program
Process - Answer -An address space and at least one thread of execution
Difference between process and program - Answer -A program is just a collection of
statements, a process is a running instance of a program.
Uniprogramming - Answer -Running one process at a time
Multithreading - Answer -having multiple threads per address space
Dispatching loop - Answer -Run thread
Save States
Choose new thread
Load states from new thread
Context switch - Answer -Switching the CPU from one thread/process to another
Thread state diagram - Answer -Ready -> Running -> Blocked ->Ready etc.
Ready-> Running: Scheduled
Running-> Ready: yield, timer
Running -> Blocked: I/O request
Blocked -> Ready: IO complete
Amdahl's Law - Answer -S = %of sequential computations
N = cores
x = 1/(S + (1-S/N))
Booting sequence - Answer -Jump
Load from BIOS
,POST
Load MBR
Load OS loader
Load kernel image
sets kernel mode
Jump
System call - Answer -Allows processes running in user mode to access kernel
functions that run under kernel mode
Kernel Mode - Answer -Used for lowest level functions of operating system. Executing
code has unrestricted access to hardware
User mode - Answer -Executing code has no way to directly access or modify hardware
or reference memory
Master Boot Record - Answer -Information in the first sector of memory that identifies
how and where to boot the OS
System call sequence - Answer -User level: Trap
Kernel Level: Set kernel mode
Branch table
Run trusted code
Process creation - Answer -fork(): Clones the process
exec: overwrites current process
to run one different from parent
pthread_create(): a newly created thread will share the address space AND resources
of current process
Starvation - Answer -Program is denied the resources it needs to work
Preemptive Scheduling - Answer -A job can be forcibly suspended by a CPU interrupt
and the CPU can work on something else.
Non Preemptive Scheduling - Answer -Once started, a job cannot be taken off the CPU
and will run to completion
First in First Out - Answer -First in first out scheduling, works best when all jobs are
short, works bad when jobs are varying sizes.
Not preemptive
, Round Robin - Answer -Jobs take predetermined length turns on the CPU. Shorter
response time, fair sharing of cpu
not all jobs preemptive, not good for jobs of the same length
Preemptive
Shortest Job first - Answer -Non preemptive
Runs whichever job is shortest first. Runs best when jobs are usually short, degradation
for longer jobs. Turns into FIFO if jobs are the same length.
Shortest time remaining first - Answer -Preemptive version of shortest job first. Short
jobs do not get stuck behind anything under SRTF
Multilevel Feedback Queue - Answer -Uses multiple queues with different priorities
Round robin: Run highest priority jobs first.
Jobs start in highest priority. If time expires they go down, if time does not expire they
go up.
Approximates SRTF, CPU jobs lose priority, I/O jobs stay near the top.
Counter measure: Aging
Lottery Scheduling - Answer -Adaptive approach to address fairness. Every process is
given a number of tickets based on its size, shorter jobs get more. Every time slice a
random "ticket" is chosen. Each job gets at least one ticket
Atomic operation - Answer -An atomic operation runs to completion, it is all or nothing
Race conditions - Answer -occur when threads share data and their results depend on
the timing of their executions
Independent Threads - Answer -No states shared with other threads
Deterministic computation
Reproducible
Cooperating threads - Answer -Shared states
Non deterministic
Non reproducible
Why?