Midterm Flashcards Preview

OP Systems > Midterm > Flashcards

Flashcards in Midterm Deck (62):
1

What are the 4 conditions for deadlock?

1. mutual exclusion
2. hold and wait
3. no pre-emption
4. circular wait

2

what condition is it when only one process may use a resource at a time?

mutual exclusion

3

what is the hold and wait deadlock condition?

a process may hold allocated resources while awaiting the assignment of others

4

what is "no pre-emption?

when no resource can be forcibly removed from a process holding it

5

what is "circular wait?"

a closed chain of processes where each process holds at least one resource needed by another process in the chain

6

what are the 3 approaches to dealing with deadlock?

prevent, avoid, detect

7

how do you prevent circular wait?

by defining a linear ordering of resource types

8

what are the two approaches to deadlock avoidance?

resource allocation denial, process initiation denial

9

list 2 advantages of deadlock avoidance over other deadlock avoidance strategies

- not necessary to preempt and rollback process like in deadlock detection
- less restrictive than deadlock prevention

10

what are the restrictions on deadlock avoidance?

- maximum resource requirement for all processes must be stated in advance
- processes being considered must be independent with no synchronization requirements
- a fixed number of resources must be allocated
- no process can exit holding resources

11

what does "unsafe status" signal in deadlock avoidance?

that deadlock is a possibility

12

list the advantages and disadvantages of deadlock detection algorithms

advantages: leads to early detection, simple algorithms
disadvantages: frequent checks consume processor time

13

how can a system recover from a deadlock?

- abort all deadlocked processes
- abort deadlock processes one by one until deadlock is gone
- back up deadlocked processes to a previous checkpoint and restart all processes
- preempt resources until deadlock is gone

14

what are GPU's?

graphical processing units that provide computations on arras of data

15

what are DSP's?

digital signal processors for streaming signals

16

what are the two steps to instruction execution?

1. process fetches instructions from memory
2. processor executes each instruction

17

what are interrupts?

interrupts, interrupt the normal sequencing of the processor

18

what is the purpose of interrupts?

to improve process utilization

19

what are the interrupt classes and how are they generated?

Program: generated by a condition
Timer: generated by a timer
I/O: generated by I/O controller
Hardware failure: generated by failure

20

what does an os do?

manages resources

21

what is batch processing?

set of programs are executed in a linear sequential order, no manual intervention, data is collected in batches of files

22

what is the uniprogramming (single batch) approach?

processor spends some amount of time executing until it hits an I/O instructions, must wait for I/O instruction to finish before continuing

23

what is the multi programming batch approach?

when one job is waiting on I/O, processor can switch to another job

24

what are the 3 components of a process?

1. an executable program
2. the associated data
3. executable context (process state) of the program

25

what is in the "trace" of a process

sequence of instructions that get executed for that process

26

what does the dispatcher do

switches processor from on process to another

27

what are the 2 characteristics of a process?

- resource ownership
- scheduling/execution

28

what are the contents of a thread?

- execution state
- thread context
- execution stack
- static storage for local variables
- access to memory and resources of its process (all threads of a process share this stuff)

29

what benefits are provided by using threads?

- threads can be created faster than processes
- threads can be killed faster than processes
- switching between threads is faster than switching between processes
- threads enhance communication efficiency between programs

30

what happens to the threads of a process when that process is terminated?

they are all terminated as well

31

if a process is suspended what happens to its threads?

they are also suspended

32

what manages user level threads?

the application

33

what are the advantages of ULT's? (User level threads)

- don't need kernel mode privileges to switch threads
- scheduling can be app specific
- ULT's run on any OS

34

what are the disadvantages of ULTs?

- when ULTs execute system calls not only is the thread normally blocked but so are all other threads associated with the process

35

how do you overcome the system call blocking that occurs in ULT?

Jacketing: coverts blocking sys calls to non-blocking sys calls, this is done by writing an app as multiple processes instead of multiple threads`

36

what are the advantages of KLT? (kernel level threading)

- kernels can schedule multiple threads from the same process on multiple processors at the same time
- if a thread is blocked the kernel can schedule another thread in the same process
- kernel allows multi threading

37

what are the disadvantages of KLTs

- transferring control between threads in the same process requires a mode switch to the kernel

38

when does the logical address (LA) change?

never

39

when does the physical address (PA) change?

when a swap occurs, i.e when the process location changes

40

how is the PA computed?

PA = LA + Base

41

what is the "BASE" in memory relocation

a cpu registered maintained by the OS that is updated after a context switch

42

what are the shortcomings of simple swapping?

- memory limits
- one size fits all (need to fragment)
- zero protection

43

what is a paging scheme?

memory is divided into equal chunks (pages) and processes can have as many pages as they require

44

what does simple paging allow? what does it manage to avoid?

for processes to be of different sizes, it avoids fragmentation

45

what is the key insight of virtual memory?

why swap all of a process? why not just swap in only the pages we need?

46

how is it that the memory space of each process can be bigger than the amount of physical memory in a computer?

because with virtual memory every process thinks it has access to the entire memory space

47

what is a page fault?

when a program tires to access objects not currently in memory

48

how does the OS respond to a page fault?

it performs a context switch pausing active process to bring needed page out from memory

49

what are the differences between paging and segmentation?

- pages are all the same length, segments can vary in size
- paging is invisible, segments are explicitly managed by the program

50

what are the drawbacks of fixed blocks for dynamic memory management?

- no flexibility
- lots of waste (oh you need 10 bytes?
here's a whole fackin block mate)
- fragmentation is possible if a larger block is needed then what the list is made up of

51

why can't the relative speed of execution of processes be predicted?

- activities of other processes can impact a process
- OS handle interrupts differently
- OS have different scheduling policies

52

what is the "race condition"?

when multiple processes or threads read and write data items and the final result depends on the order of execution ("loser" of the race is the process that updates last)

53

what must an OS do to deal with concurrency

- keep track of various processes
- allocate and de-allocate resources
- protect data and physical resources from interference from other processes
- ensure process outputs are independent of the speed of execution

54

what 3 control problems must be faced when dealing with competing processes?

- need for mutual exclusion
- deadlock
- starvation

55

what are the requirements for mutual exclusion?

- needs to be enforced no matter what
- a process must not interfere with other processes when it halts
- a process needs to be able to access a critical section if no other process is using it
- relative process speeds or number of processes are irrelevant
- a process remains in its critical section for a finite time only

56

what are the disadvantages of interrupt disabling for mutual exclusion?

- efficiency of execution goes down
- will not work on multiprocessor architecture`

57

what are the advantages of special machine instruction for mutual exclusion?

- applicable to any number of processes on single or multiprocessors sharing memory
- simple and easy to verify
- can support multiple critical sections (each defined by its own variable)

58

what are the disadvantages of special machine instructions for mutual exclusion?

- while processes wait for access to critical section it consumes processor time
- starvation is possible when process leaves critical section and several processes are waiting
- deadlock is also possible

59

how can you know whether a semiphore will block or not?

you can't know before a process decrements

60

if two processes are running currently how can a semiphore indicated which process will continue immediately on a uni processor

it can't help

61

can you know using a semiphore how many processes are waiting?

no

62

what is the difference between strong and weak semiphores?

strong semiphores release processes based on FIFO, weak semiphores have no order in which to release processes