Chapter 8 Flashcards

(20 cards)

1
Q

What’s the point of chapter 8?

A
  • Processes can execute at the same time. Concurrent access to shared data may result in data inconsistency
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What’s the purpose of a counter?

A

A counter will keep track of the full buffers

  • It is set to 0
  • Producer will increment it when producing a new buffer
  • Consumer will decrement it after it consumes the buffer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a Critical Section?

A
  • Each process has a critical section segment of code
  • Process will change common variables, update the file etc.
  • Only one process can be in it’s critical section at a time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the Critical Section Problem?

A
  • A design protocol to solve the issue
  • Each process must first ask permission in the entry section, will then go to the exit section followed by the remainder section
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Mutual exclusion ( The first step in the Critical selection problem)

A
  • Only one process can be executing in their critical selection at a time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Progress ( The second step in the critical Selection problem)

A

-If no one process is executing in it’s critical section and another process wants to move on to the critical section then it can’t be postponed.

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

What is Bounded Waiting ( The third step in the critical Selection problem)

A
  • A limit must exist on the number of times that other processes are allowed to enter their critical sections after a process has made that request
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a Preemptive kernel?

A
  • Allows preemption of the kernel when running in kernel mode
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a Non - Preemptive kernel?

A
  • Runs until it exits kernel mode. Blocks or voluntarily yields CPU
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is Peterson’s solution?

A
  • Introduces two variables
    int turn; - Indicates whose turn it is to enter the critical section
    Boolean flag [2] - Is an array that stores all the processes ready to enter the critical section
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the main theme of hardware solutions to solve the issue.

A
  • Hardware solutions are based on the idea of locking or protecting critical regions via lock
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do Uniprocessors try to solve the issue?

A
  • Can disable interrupts which isnt viable on multiprocessor systems
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are some Software solutions?

A
  • Simplest is a mutex lock
  • Protects critical section by first acquiring and then releasing the lock
  • Calls to do this must be atomic or non- interruptable
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a semaphore?

A
  • A synchronization tool that provides more ways for a process to synchronize their activities
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the difference between a counting semaphore and a Binary Semaphore.

A
  • Counting Semaphore can be set to any value

- Binary semaphore can only be set to 1 or 0

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

What is a block?

A
  • Places the process invoking the operation on the appropriate waiting queue
17
Q

What is Wakeup?

A
  • Removes one of the processes in the waiting queue and places it in the ready queue
18
Q

What’s a deadlock?

A
  • Two or more processes waiting indefinitely for an event that can be caused by only one of the waiting processes
19
Q

What is Starvation?

A
  • A process may never be removed from the semaphore queue in which its suspended
20
Q

What is Priority Inversion?

A
  • A scheduling problem when lower priority process holds a lock needed by a higher priority process.
  • solved via priority Inheritance protocol