Chapter Six Notes Flashcards

1
Q

Race condition

A

A situation where several processes access
and manipulate the same data concurrently and the
outcome of the execution depends on the
particular order in which the access takes place

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

Multiple processes can be in the critical section at once (T/F)

A

False

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

Critical section problem

A

To design protocol to solve this the processes must synchronize their activity so as to cooperatively share data. Each process must
request permission to enter its critical section.

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

Each process must ask permission to enter critical section
in remainder section, may follow critical section with exit
section, then entry section
(T/F)

A

False, entry section -> critical section -> exit section -> remainder section

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

Solution to critical section problem must include

A

1) Mutual Exclusion - If process Pi is executing in its
critical section, then no other processes can be
executing in their critical sections

2) Progress - If no process is executing in its critical
section and there exist some processes that wish to
enter their critical section, then the selection of the
processes that will enter the critical section next
cannot be postponed indefinitely

3) Bounded Waiting - A bound must exist on the
number of times that other processes are allowed
to enter their critical sections after a process has
made a request to enter its critical section and
before that request is granted
— Assume that each process executes at a
nonzero speed
— No assumption concerning relative speed of
the n processes

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

Preemptive kernel

A

Allows preemption of process
when running in kernel mode.
* Pre-emptive kernels are especially
difficult to design for SMP architectures
* But a preemptive kernel may be more
responsive.
* A preemptive kernel is more suitable for
real-time programming

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

Non-preemptive kernel

A

Runs until exits kernel
mode, blocks, or voluntarily yields CPU
* Essentially free of race conditions in
kernel mode

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

Petersons Solution

A

Two process solution; assumed load and storage are atomic (uninterruptible); variable turn is used to determine which process’ turn it is to enter critical section, the flag array is used to indicate if a process is ready to enter.

Meets all three CS requirements.

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

Problem with Peterson’s Solution

A

Peterson’s solution is not guaranteed to work on modern
computer architectures for the primary reason that, to improve
system performance, processors and/or compilers may reorder
read and write operations that have no dependencies.

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

Hardware instructions

A

1) test_and_set() instruction: operates on two words atomically

2) compare_and_swap() instruction: operates on two words atomically, but uses a
different mechanism that is based on swapping the content of two
words

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

Bounded waiting

A

A bound must exist on the number of times that other processes are
allowed to enter their critical sections after a process has made a request to enter its critical
section and before that request is granted

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

Mutex Lock

A

Requires busy waiting, is called a spinlock.
acquire() a lock, then release() a lock. Calls must be atomic. Can be implemented using CAS. No context switch is required.

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

Semaphore

A
  • Synchronization tool that provides more
    sophisticated ways (than Mutex locks) for process
    to synchronize their activities.
  • Can only be accessed via two indivisible (atomic)
    operations
  • wait() and signal()
  • Can be implemented with no busy waiting.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Counting semaphore

A

integer value can range over
an unrestricted domain

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

Binary semaphore

A

integer value can range only
between 0 and 1
* Same as a mutex lock

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

Deadlock

A

two or more processes are waiting indefinitely for an event that can be
caused by only one of the waiting processes

17
Q

Liveness

A

refers to a set of properties that a system
must satisfy to ensure that processes make
progress during their execution life cycle.
* A process waiting indefinitely under the
circumstances just described is an example of a
“liveness failure.”