Chapter 6 Synchronization Flashcards

1
Q

How can more than one reader enter the critical section or shared?

A

readCount++;

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

How does a writer prevent another writer from entering the critical section?

A

P(writeblock)

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

What is the critical section?

A

A collection of operations in which only one process may be executing at a given time.

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

What does Mutual Exclusion, Process and Bounded wait mean?

A

Mutual Exclusion - Only one process can be in the critical section at a time.

Process - When no process is in the critical section, there’s a process that may want to execute and enters the critical section to execute, it would not be postponed indefinitely.

Bounded wait - When a process wants to execute, other processes are given a certain amount of time to enter the critical section before.

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

In Peterson’s solution to the critical section, what’s the purpose of the variable flag?

A

To determine which process wants enter the critical section.

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

What is a busy wait?

A

A process waits and is busy repeatedly checking to see if the condition is true.

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

Define race condition

A

A situation where two or more processes access shared data concurrently and the outcome depends on the order of execution.

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

What are cooperating processes?

A

Processes that interact with one another indirectly by sharing a common object.

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

What is a semaphore?

A

An OS abstract type that allows one process to control the shared resource while the other process waits for the resource to be released.

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

What’s the difference between a Counting semaphore and Binary semaphore?

A

Counting semaphore – integer value can range over an unrestricted domain.

Binary semaphore – integer value can range only between 0 and 1; can be simpler to implement.

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

What is Starvation?

A

A process may never be removed from the semaphore queue in which it is suspended. (indefinite blocking)

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

What is Deadlock?

A

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

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