theory and practice Flashcards

(9 cards)

1
Q
  • Mutual exclusion problem
A

In many computer systems, processes must cooperate with each other when accessing shared data. The designer must ensure that only one process at a time modifies the shared information. During the execution of such critical sections of code mutual exclusion must be ensured.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
  • Producer-Consumer problem
A

In this problem a set of producer processes provide messages to a set of consumer processes. They all share a common pool of space into which messages may be placed by the producers and removed by the consumers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
  • Reader-Writer problem
A

In this problem reader processes access shared data but do not alter it while writer processes change the contents of the shared data. Any number of readers should be allowed to proceed concurrently in the absence of a writer, but writers must insist on mutual exclusion while in their critical section.

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

SEMAPHORE

A

A semaphore is an integer variable, S, and an associated group of waiting processes, Q(S), upon which only two operations, P and V , may be performed.

P (S) if S ≥ 1 then S = S − 1 else the executing process places itself in Q(S) and goes to sleep.

V (S) if Q(S) is non-empty then wake up one waiting process and make it available for execution else S = S + 1.

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

circular hold and wait:

A
  • circular hold and wait: There must exist a set of waiting processes {p1, p2, . . . , pn}
    such that p1 is waiting for a resource held by p2, p2 is waiting for a resource that is
    held by p3, . . ., pn is waiting for a resource that is held by p1. The resources involved
    must be held in a non-sharable mode
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

deadlock

A

A set of processes is in a state of deadlock when every process in the set is waiting for a resource that can only be released by another process in the set

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

linear ordering

A

To do this one must define a 1 − 1 function F that maps resource types to integer numbers.suppose that we insist that each process can only request resources in increasing order of enumeration. To do this we require that whenever a process requests a resource rj it first releases any resource ri such that F (ri) > F (rj ). If this protocol is followed then a circular hold and wait condition cannot happen.

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

Bankers algorithm

A

ensures that a circular hold and wait condition cannot occur by demanding that at any time the system is in a safe state. More formally, a system of processes is in a safe state if there exists a sequence, {p0, p1, . . . , pn−1} such that for each pi the resources which pi can still request can be satisfied by the available resources plus the resources held by all the pj with j < i

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

preemption

A

To prevent the hold and wait condition we allow implicit preemption. If a process that is holding some resources requests another resource that cannot be immediately allocated to it then all resources currently held are preempted and implicitly released. The preempted
resources are added to the list of resources for which the process is waiting. The process will only be restarted when it can regain all its old resources as well as the new one that it requested

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