Final (cumulative) Flashcards
What is batch programming?
A way of executing programs such that each program is completed before the next starts
What is a multiprogramming batch?
Program B is scheduled to run while program A waits for I/O
What are the 2 steps of instruction execution for a program?
- Processor fetches instructions from memory
2. Processor executes each instruction
What are the 4 classes of interrupts?
Program, Timer, I/O, Hardware failure
What are the 3 components of a process?
An executable program, data needed by the program, the execution context (process state) of the program
What does the execution context of a program contain?
-data by which the OS is able to supertivse and control the process: content of process registers, priority of process
What is the dispatcher?
A small program that switches the processor from one process to another
What are the states in the two-state process model?
Running, not running
What are the states in the five-state process model?
New, Ready, Running, blocked, exit
What are the benefits of threads?
Takes less time to create, terminate, and switch between threads than processes
-enhance efficiency in communications between programs
What are the possible states of a thread?
Ready, Running, Blocked
What are the advantages of user level threads?
- switching does not require kernel mode privileges
- scheduling can be application specific
- can run on any OS
How can you overcome the disdvantages of ULT?
- Jacketing: turn blocking system calls into non-blocking calls
- Write application as multiple processes rather than threads
What are the advantages of kernel-level threads?
- can simultaneously schedule miltiple threads from 1 process on multiple processors
- if one thread in process is blocked, kernel can schedule another thread of the same process
- routines can be multithreaded
What is an I/O constrained task?
A task that is slow because it is waiting for something (user input, communication, completion of ther job, etc)
What is a computationally heavy tast?
A task that takes a long time
When will a blocked process be suspended?
When no processes in main memory are ready, the OS swaps a blocked process onto disk into suspended queue
What are the two characteristics of a process?
- Resource ownership: virtual address space to hold process image
- Scheduling/execution: follows execution path interleaved with other processes
What are the different schemes used to prevent deadlock?
- Request all resources at once
- Preemption
- Resource Ordering
What are the conditions required for deadlock?
Mutual exclusion, hold-and-wait, no preemption, circular wait
What info must be stored and replaced during a context switch?
Stack, page table, program counter, CPU registers
What are the reasons for process creation?
- New batch job
- Interactive logon
- Created by OS to provide a service
- Spawned by existing process
(T/F) All threads of a process have a unique address space?
False
What are the 3 categories of I/O devices?
- Human readable
- Machine readable
- Communication
What category of I/O device is a USB key?
Machine readable