Midterm Flashcards

1
Q

POSIX

A

Portable Operating system Interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

BSD

A

Berkeley Software Distribution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

GNU

A

GNU not Unix

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

deadlock

A

A set of two or more threads is deadlocked if each thread in the set is waiting (blocked) for an event that only another thread in the set can cause.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

livelock

A

A livelock is a deadlock caused by busy waiting rather than being asleep (blocked).
starvation (p463-464) -
when a process must wait an excessive length of time for a resource

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

zombie state

A

A child that is terminated but the parent is no longer there to accept the exit message from the child.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What four conditions are necessary for a deadlock to occur?

A
  1. Mutual exclusion condition
    A resource is assigned to exactly 1 thread or it is available
  2. Hold and wait condition
    a thread may hold resources while requesting additional resources
  3. No preemption condition.
    previously granted resources cannot forcibly be taken away
  4. Circular wait condition.
    must be a circular chain of 2 or more threads.
    each is waiting for resource held by next member of the chain
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

who showed the deadlock conditions

A

Coffman

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

List four strategies that could be used to deal with deadlocks

A
  1. Just ignore the problem
    general purpose computing because it’s cheap
    1. Detection and recovery
    2. Dynamic avoidance
      Possibility of deadlock exists, but system is monitored so it can be avoided
    3. Prevention
      Level the “cliff”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does a “resource graph” look like?

A

Circles are processes, squares are resources, arrows from resources indicate ownership, and arrows from processes indicate requests (waits)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How can one be used to detect a deadlock?

A

A depth-first search of a linked list model of a resource graph will detect cycles, indicated by revisiting a previously visited node.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How could we detect deadlocks when there are multiple resources of each type

A

Using a current allocation matrix and a request matrix to roll down the requests from the allocations.

A = E - C, where:
E = total of each resource
C = how many of each resource is currently allocated
A = total of each resource still available
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Assuming that a deadlock could be detected, what 3 techniques are mentioned in the textbook
that could be used to recover from a deadlock?

A
  1. Recover through preemption
    take a resource from some other process
    depends on nature of the resource
  2. Recovery through rollback
    checkpoint a process periodically
    use this saved state
    restart the process if it is found deadlocked
  3. Recovery through killing process
    crudest but simplest way to break a deadlock
    kill one of the processes in the deadlock cycle
    the other processes get its resources
    choose process that can be rerun from the beginning
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are “safe” and “unsafe” states?

A

Unsafe
Inside a box, but not yet at a corner, because a deadlock is inevitable unless the other process is terminated or releases a resource before making additional requests..
Safe
In any arbitrary box, or on the line of the “Danger Zone”box (box below and left of the double lined box).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Is an unsafe state the same thing as a deadlock?

A

No. An unsafe state indicates the future deadlock that can only be avoided by external forces or by one of the processes changing its mind about needing a resource.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Review Dijkstra’s Banker’s algorithm. You should be able to use the banker’s algorithm to
determine whether or not a given state is safe or unsafe.

A

Take A’s value, and see there are enough resources for a process to complete. After it completes, recount P and subtract to find new value of A. Wash, rinse, repeat.

17
Q

List four techniques could theoretically be used to prevent deadlocks. Given a scenario that
describes a potential deadlock, you should be able to describe how each of these 4 techniques
would be used to prevent a deadlock.

A
  1. Avoid Mutual Exclusion
  2. Avoid Hold and Wait
    if there is a deadlock, all processes give up their resources, then request all the resources they need to complete.
  3. Avoid No Preemption condition
  4. Avoid Circular Wait
    a process must be allowed all resources before it begins execution; used in databases
    Cars, train, barge illustration - point is to request destination resource ahead of time, AKA numerical order, but not sequential.
18
Q

Who was instrumental in the original development of UNIX?

A

Ken Thompson

19
Q

Who designed the C programming language? For what company did they work?

A

Dennis Ritchie, Bell Labs

20
Q

What were (are) some of the goals for the development of UNIX?

A

Consistent
Servant, not a nanny.
Non-redundant

21
Q

What university was instrumental in the further development of UNIX?

A

UC Berkeley

22
Q

What are some of the enhancements that this university implemented in their version of UNIX?

A

virtual memory, networking TCP/IP, long filenames

23
Q

What is the primary purpose behind POSIX?

A

standards, trying to make UNIX the same in all implementations

24
Q

Who wrote MINIX, a small UNIX-like operating system that was intended for instructional use?

A

Andrew Tanenbaum

25
Q

Who expanded MINIX to make LINUX?

A

Linus Torvalds