Chapter 6 - Synchronization Tools Flashcards

1
Q

When does a race condition occur?

A

A race condition occurs when processes have concurrent access to shared data and the final result depends on the particular order in which concurrent addresses occur. Race conditions can result in corrupted values of shared data.

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

What is a critical section?

A

A critical section is a section of code where shared data may be manipulated and a possible race condition may occur. The critical-section problem is to design a protocol whereby processes can synchronize their activity to cooperatively share data.

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

What are the three requirements for a solution to the critical-section problem?

A

A solution to the critical-section problem must satisfy the following three requirements:
1. mutual exclusion
2. progress
3. bounded waiting

Mutual exclusion ensures that only one process at a time is active in its critical section.
Progress ensures that programs will cooperatively determine what process will next enter its critical section.
Bounded waiting limits how much time a program will wait before it can enter its critical section.

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

What does a mutex lock provide?

A

A mutex lock provides mutual exclusion by requiring that a process acquire a lock before entering a critical section and release the lock on exiting the critical section.

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

What do semaphores provide?

A

Semaphores, like mutex locks, can be used to provide mutual exclusion. However, whereas a mutex lock has a binary value that indicates if the lock is available or not, a semaphore has an integer value and can therefore be used to solve a variety of synchronization problems.

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

What is a monitor?

A

A monitor is an abstract data type that provides a high-level form of process synchronization. A monitor uses condition variables that allow processes to wait for certain conditions to become true and to signal one another when conditions have been set to true.

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