Module 2 Flashcards

1
Q

What is the purpose with synchronization?

A

That access to shared data must be controlled to avoid erroneous behavior and corruption of data

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

What are some mechanisms to control access to shared resources?

A

Locks, mutexes, semaphores, monitors, condition variables.

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

Why do we use mutual exclusion?

A

So that only one thread is allowed to be in its critical region at a certain time.

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

How is mutual exclusion programmed?

A

By using locks.

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

How does condition synchronization work?

A

Signal a condition, a process sets a shared variable.

Implemented by having one thread wait for a signal from another thread.

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

What is busy waiting?

A

When a thread waits for a condition and process repeatedly tests a variable until it becomes true.

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

What is the critical section?

A

A segment of code where processes access shared resources, such as common variables and files, and perform operations on them. Only one thread should have access to this part of the code at a time.

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

What is an atomic action?

A

A sequence of one or more statements that need to be executed as a single indivisible action, or not at all.

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

What is a fine-grained atomic action?

A

A action that can be implemented in a single step, i.e. by a single instruction.

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

What is a coarse-grained action?

A

An action that can be implemented in several steps as a critical section.

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