Concurrency 3 Flashcards

1
Q

What is stale data? What causes it?

A

Stale data is data that is not up to date. It is caused by data inconsistency.

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

What causes data inconsistency?

A

Thread communication issues such as deadlock, live lock and starvation.

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

Implementing correct thread management ensures…

A

Fresh data is maintained across the program. Fresh data means that data is consistent.

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

Define Atomic Variables…

A

Atomic Variables are ones which are to be operated in by atomic actions. When modified, these variables have no intermediate state, thus are immune to becoming stale.

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

What determines whether to use Synchronised or Atom Actions?

A

Synchronised - Use when there is a large code block, as the entirety of the object is locked which is a cumbersome process.
Atomic Action - Used when only a small section of the program (i.e some variables) need to be updated. This is a lightweight process.

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

How does the volatile keyword ensure data freshness?

A

When volatile is used, the variable will change consistently across all threads when updated. This removes the possibility of data inconsistency.

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

Define publishing an object…

A

Publishing an object means to make the object visible from outside its current scope.

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

Define escaping an object…

A

When an object escaped, it means it unintentionally becomes viewable from outside its local scope.

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

Define Thread confinement…

A

This is to store the static data of a program in a single thread that wont change.

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