Shared Flashcard Set

Details

OS Midterm
Studying for OS Midterm
29
Computer Science
Graduate
03/12/2012

Additional Computer Science Flashcards

 


 

Cards

Term
What are the 5 process states?
Definition
New, Running, Waiting, Ready, and Terminated
Term
What is the Process Control Block (PCB)?
Definition
It is a piece of memory that has info about a process including state, program counter, CPU registers, CPU scheduling info, memory management info, accounting info, and I/O status.
Term
Name 3 pieces of information contained in a PCB
Definition
  • process state
  • program counter
  • CPU registers
  • CPU scheduling info
  • memory management info
  • accounting info
  • I/O status
Term
What is the Job Queue?
Definition
a list of all the processes in the system
Term
What is the Ready Queue?
Definition
a list of all the processes ready and waiting to execute
Term
What is the Device Queue?
Definition
a list of processes waiting for a particular I/O device.
Term
What is an I/O Bound Process?
Definition
a process that spends most of its time doing I/O
Term
What is a CPU Bound Process?
Definition
a process that spends most of its time doing computations
Term
Short-Term Scheduler
Definition
???
Term
Medium-Term Scheduler
Definition
???
Term
Long-Term Scheduler
Definition
???
Term
What does the exec() command do in Unix/C?
Definition
It is a system call that replaces the current executable with a new executable.
Term
What is a deadlock?
Definition
A situation where a waiting process is never again able to change state because resources it needs are held by other waiting processes.
Term
What are the three steps that occur in the normal mode of operation when a process wants to utilize a resource?
Definition

1. Request the resource (waiting if not available)

2. Use the resource (exclusively)

3. Release the resource (so others can use it)

Term
What are the 4 conditions that must hold for a deadlock?
Definition

1. Mutual Exclusion - nonsharable resource held

2. Hold and Wait - a process is holding a resource and waiting on another resource

3. No Preemption - a process can only be interrupted/prempted by itself (after completion)

4. Circular Wait - the hold and wait chain is circular

Term
Resource Allocation Graph
Definition
Know about the resource allocation graph in 7.2.2. It allows you to check for deadlocks.
Term
Three General Approaches to Handling Deadlocks
Definition

1. Use protocol to prevent or avoid deadlocks

2. Allow a system to deadlock, detect it, and then recover

3. Ignore the problem and hope deadlocks never occur

Term
Deadlock Prevention
Definition
Generally speaking, tries to ensure that at least on of the 4 deadlock conditions cannot hold.
Term
Deadlock Avoidance
Definition
Generally speaking, the OS basically requires that processes tell in advance what resources they will need during their lifetime. This information can then be used to schedule the processes to avoid a deadlock.
Term
Can the denial mutual exclusion be used for deadlock prevention?
Definition
No, because some resources are intrinsically nonsharable and need mutual exclusion.
Term
Can we prevent hold and wait from ever occurring to prevent deadlock?
Definition
Yes, two ways are to either force a process to request all (or none) resources before execution or make a process release its current resources before requesting more.
Term
How can the denial of 'No Preemption' be used to prevent deadlock?
Definition
If a process is holding some resources and requests another resource that isn't available, then this process will be preempted. Similarly, if a process needs resources that a process who is waiting has, then that other process can be prempted of its resources.
Term
Can the denial of the 'Circular Wait' condition be used to prevent deadlock?
Definition
Yes, by imposing a total ordering on resource types and then requiring that processes request resources in that ordering.
Term
Safe State (in the context of deadlock avoidance)
Definition
A state is safe if the system can allocate resources to each process (up to its maximum) in some order and still avoid a deadlock.
Term
Safe Sequence
Definition
A system is in a safe state if there is a safe sequence. A safe sequence is a sequence of processes that can execute given the current allocation of resources and the newly released resources of the processes that execute before it.
Term
Resource Allocation Graph Algorithm
Definition
This is in section 7.5.2, it is a variation of the resource allocation graph that allows for deadlock avoidance by adding a claim edge (dotted directed edge) for future resource needs of a process.
Term
Banker's Algorithm
Definition
You have the matrices: available, max, and allocation. You need to comput the matrix: Need by doing (Max - Allocation).
Term
Deadlock Detection Algorithm
Definition
You have matrices: available, allocation, and request. You then calculate a vector, Finish, by checking if the request can be satisfied by the available.
Supporting users have an ad free experience!